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:
parent
60e2abde1b
commit
70d464189f
1 changed files with 10 additions and 2 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue