mirror of
https://github.com/penpot/penpot.git
synced 2025-01-23 23:18:48 -05:00
🐛 Fix pinch to zoom on mac
This commit is contained in:
parent
b78d9dcc52
commit
b6f2800aa3
1 changed files with 2 additions and 1 deletions
|
@ -379,6 +379,7 @@
|
|||
(dom/stop-propagation event)
|
||||
(let [pt (->> (dom/get-client-position event)
|
||||
(utils/translate-point-to-viewport viewport zoom))
|
||||
ctrl? (kbd/ctrl? event)
|
||||
|
||||
delta-mode (.-deltaMode ^js event)
|
||||
|
||||
|
@ -394,7 +395,7 @@
|
|||
delta-x (-> (.-deltaX ^js event)
|
||||
(* unit)
|
||||
(/ zoom))]
|
||||
(if mod?
|
||||
(if (or ctrl? mod?)
|
||||
(let [delta (* -1 (+ (.-deltaY ^js event) (.-deltaX ^js event)))
|
||||
scale (-> (+ 1 (/ delta 100)) (mth/clamp 0.77 1.3))]
|
||||
(st/emit! (dw/set-zoom pt scale)))
|
||||
|
|
Loading…
Add table
Reference in a new issue