🐛 Fix mouse zoom on viewer and workspace.

This commit is contained in:
Andrey Antukh 2020-04-08 19:18:48 +02:00
parent 3f925690ee
commit 14ff64d3d7
3 changed files with 33 additions and 30 deletions

View file

@ -52,8 +52,12 @@
on-mouse-wheel
(fn [event]
(when (kbd/ctrl? event)
;; Disable browser zoom with ctrl+mouse wheel
(dom/prevent-default event)))
(dom/prevent-default event)
(let [event (.getBrowserEvent event)]
(if (pos? (.-deltaY event))
(st/emit! dv/decrease-zoom)
(st/emit! dv/increase-zoom)))))
on-mount
(fn []