mirror of
https://github.com/penpot/penpot.git
synced 2025-01-22 22:49:01 -05:00
🐛 Fix zoom in/out after fit or fill in viewer
This commit is contained in:
parent
c3e37b0e04
commit
b4bf6b9235
2 changed files with 11 additions and 8 deletions
|
@ -72,6 +72,7 @@
|
||||||
- Fix default profile image generation issue [Taiga #2601](https://tree.taiga.io/project/penpot/issue/2601)
|
- Fix default profile image generation issue [Taiga #2601](https://tree.taiga.io/project/penpot/issue/2601)
|
||||||
- Fix edit blur attributes for multiselection [Taiga #2625](https://tree.taiga.io/project/penpot/issue/2625)
|
- Fix edit blur attributes for multiselection [Taiga #2625](https://tree.taiga.io/project/penpot/issue/2625)
|
||||||
- Fix auto hide header in viewer full screen [Taiga #2632](https://tree.taiga.io/project/penpot/issue/2632)
|
- Fix auto hide header in viewer full screen [Taiga #2632](https://tree.taiga.io/project/penpot/issue/2632)
|
||||||
|
- Fix zoom in/out after fit or fill [Taiga #2630](https://tree.taiga.io/project/penpot/issue/2630)
|
||||||
|
|
||||||
### :arrow_up: Deps updates
|
### :arrow_up: Deps updates
|
||||||
|
|
||||||
|
|
|
@ -190,19 +190,21 @@
|
||||||
(ptk/reify ::increase-zoom
|
(ptk/reify ::increase-zoom
|
||||||
ptk/UpdateEvent
|
ptk/UpdateEvent
|
||||||
(update [_ state]
|
(update [_ state]
|
||||||
(let [increase #(nth c/zoom-levels
|
(let [increase (fn [zoom]
|
||||||
(+ (d/index-of c/zoom-levels %) 1)
|
(d/seek #(> % zoom)
|
||||||
(last c/zoom-levels))]
|
c/zoom-levels
|
||||||
(update-in state [:viewer-local :zoom] (fnil increase 1))))))
|
zoom))]
|
||||||
|
(update-in state [:viewer-local :zoom] increase)))))
|
||||||
|
|
||||||
(def decrease-zoom
|
(def decrease-zoom
|
||||||
(ptk/reify ::decrease-zoom
|
(ptk/reify ::decrease-zoom
|
||||||
ptk/UpdateEvent
|
ptk/UpdateEvent
|
||||||
(update [_ state]
|
(update [_ state]
|
||||||
(let [decrease #(nth c/zoom-levels
|
(let [decrease (fn [zoom]
|
||||||
(- (d/index-of c/zoom-levels %) 1)
|
(d/seek #(< % zoom)
|
||||||
(first c/zoom-levels))]
|
(reverse c/zoom-levels)
|
||||||
(update-in state [:viewer-local :zoom] (fnil decrease 1))))))
|
zoom))]
|
||||||
|
(update-in state [:viewer-local :zoom] decrease)))))
|
||||||
|
|
||||||
(def reset-zoom
|
(def reset-zoom
|
||||||
(ptk/reify ::reset-zoom
|
(ptk/reify ::reset-zoom
|
||||||
|
|
Loading…
Add table
Reference in a new issue