0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-10 08:50:57 -05:00

🐛 Fixes scroll speed on firefox

This commit is contained in:
alonso.torres 2021-01-13 13:02:27 +01:00 committed by Andrey Antukh
parent 60e2abde1b
commit 70d464189f

View file

@ -56,7 +56,8 @@
[potok.core :as ptk]
[promesa.core :as p]
[rumext.alpha :as mf])
(:import goog.events.EventType))
(:import goog.events.EventType
goog.events.WheelEvent))
;; --- Coordinates Widget
@ -432,7 +433,14 @@
(.contains ^js node target)
(let [event (.getBrowserEvent ^js event)
delta (.-deltaY ^js event)
delta-mode (.-deltaMode ^js event)
unit (cond
(= delta-mode WheelEvent.DeltaMode.PIXEL) 1
(= delta-mode WheelEvent.DeltaMode.LINE) 16
(= delta-mode WheelEvent.DeltaMode.PAGE) 100)
delta (* (.-deltaY ^js event) unit)
delta (/ delta @refs/selected-zoom)]
(dom/prevent-default event)
(dom/stop-propagation event)