mirror of
https://github.com/penpot/penpot.git
synced 2025-05-19 20:56:11 +02:00
🐛 Fix shortcuts for zoom now take into account the mouse position
This commit is contained in:
parent
468e61e1e0
commit
0d9695de1d
3 changed files with 21 additions and 14 deletions
|
@ -28,6 +28,7 @@
|
||||||
- Fix problem with text editor in Safari
|
- Fix problem with text editor in Safari
|
||||||
- Fix unlink library color when blur color picker input [#3026](https://github.com/penpot/penpot/issues/3026)
|
- Fix unlink library color when blur color picker input [#3026](https://github.com/penpot/penpot/issues/3026)
|
||||||
- Fix snap pixel when moving path points on high zoom [#2930](https://github.com/penpot/penpot/issues/2930)
|
- Fix snap pixel when moving path points on high zoom [#2930](https://github.com/penpot/penpot/issues/2930)
|
||||||
|
- Fix shortcuts for zoom now take into account the mouse position [#2924](https://github.com/penpot/penpot/issues/2924)
|
||||||
|
|
||||||
### :arrow_up: Deps updates
|
### :arrow_up: Deps updates
|
||||||
|
|
||||||
|
|
|
@ -440,12 +440,12 @@
|
||||||
:increase-zoom {:tooltip "+"
|
:increase-zoom {:tooltip "+"
|
||||||
:command ["+" "="]
|
:command ["+" "="]
|
||||||
:subsections [:zoom-workspace]
|
:subsections [:zoom-workspace]
|
||||||
:fn #(st/emit! (dw/increase-zoom nil))}
|
:fn #(st/emit! (dw/increase-zoom))}
|
||||||
|
|
||||||
:decrease-zoom {:tooltip "-"
|
:decrease-zoom {:tooltip "-"
|
||||||
:command ["-" "_"]
|
:command ["-" "_"]
|
||||||
:subsections [:zoom-workspace]
|
:subsections [:zoom-workspace]
|
||||||
:fn #(st/emit! (dw/decrease-zoom nil))}
|
:fn #(st/emit! (dw/decrease-zoom))}
|
||||||
|
|
||||||
:reset-zoom {:tooltip (ds/shift "0")
|
:reset-zoom {:tooltip (ds/shift "0")
|
||||||
:command "shift+0"
|
:command "shift+0"
|
||||||
|
|
|
@ -28,20 +28,26 @@
|
||||||
(update :vbox merge (select-keys vbox' [:x :y :width :height])))))
|
(update :vbox merge (select-keys vbox' [:x :y :width :height])))))
|
||||||
|
|
||||||
(defn increase-zoom
|
(defn increase-zoom
|
||||||
[center]
|
([]
|
||||||
|
(increase-zoom ::auto))
|
||||||
|
([center]
|
||||||
(ptk/reify ::increase-zoom
|
(ptk/reify ::increase-zoom
|
||||||
ptk/UpdateEvent
|
ptk/UpdateEvent
|
||||||
(update [_ state]
|
(update [_ state]
|
||||||
|
(let [center (if (= center ::auto) @ms/mouse-position center)]
|
||||||
(update state :workspace-local
|
(update state :workspace-local
|
||||||
#(impl-update-zoom % center (fn [z] (min (* z 1.3) 200)))))))
|
#(impl-update-zoom % center (fn [z] (min (* z 1.3) 200)))))))))
|
||||||
|
|
||||||
(defn decrease-zoom
|
(defn decrease-zoom
|
||||||
[center]
|
([]
|
||||||
|
(decrease-zoom ::auto))
|
||||||
|
([center]
|
||||||
(ptk/reify ::decrease-zoom
|
(ptk/reify ::decrease-zoom
|
||||||
ptk/UpdateEvent
|
ptk/UpdateEvent
|
||||||
(update [_ state]
|
(update [_ state]
|
||||||
|
(let [center (if (= center ::auto) @ms/mouse-position center)]
|
||||||
(update state :workspace-local
|
(update state :workspace-local
|
||||||
#(impl-update-zoom % center (fn [z] (max (/ z 1.3) 0.01)))))))
|
#(impl-update-zoom % center (fn [z] (max (/ z 1.3) 0.01)))))))))
|
||||||
|
|
||||||
(defn set-zoom
|
(defn set-zoom
|
||||||
[center scale]
|
[center scale]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue