0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-22 22:49:01 -05:00

Merge pull request #5324 from penpot/superalex-fix-panning-events

🐛 Fix streaming of panning events
This commit is contained in:
Belén Albeza 2024-11-18 15:39:21 +01:00 committed by GitHub
commit 05e77957ca
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -157,6 +157,8 @@
(rx/filter mse/pointer-event?)
(rx/filter #(= :delta (:source %)))
(rx/take-until stopper)
;; Some events are executed in synchronous way like panning with backspace pressed
(rx/observe-on :af)
(rx/map (fn [event]
(let [delta (dm/get-prop event :pt)]
(update-viewport-position {:x #(- % (/ (:x delta) zoom))