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

Make aware of scroll the selrect component.

This commit is contained in:
Andrey Antukh 2016-02-15 22:58:33 +02:00
parent f36a61dcc6
commit c2fb18a2df

View file

@ -69,11 +69,14 @@
(reset! selrect-pos nil)))
(init []
(as-> wb/interactions-b $
(rx/filter #(not= % :draw/selrect) $)
(rx/take 1 $)
(rx/take-until $ wb/mouse-s)
(rx/subscribe $ on-value nil on-complete)))]
(let [stoper (->> wb/interactions-b
(rx/filter #(not= % :draw/selrect))
(rx/take 1))
pos (gpt/add @wb/mouse-a @wb/scroll-a)]
(reset! selrect-pos {:start pos :current pos})
(as-> wb/mouse-s $
(rx/take-until stoper $)
(rx/subscribe $ on-value nil on-complete))))]
(as-> wb/interactions-b $
(rx/dedupe $)