0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-03-13 16:21:57 -05:00

Adapt the rest of the platform for actions api changes.

Signed-off-by: Andrey Antukh <niwi@niwi.nz>
This commit is contained in:
Andrey Antukh 2016-02-29 17:19:23 +02:00
parent 5d5a0c9ea0
commit 4dd97ca8ab
7 changed files with 11 additions and 6 deletions

View file

@ -63,8 +63,7 @@
:else
(do
(dom/stop-propagation event)
(uuc/release-action! :draw/selrect)
(uuc/release-action! :shape/movement))))
(uuc/release-all-actions!))))
(declare handlers)

View file

@ -56,8 +56,7 @@
:else
(do
(dom/stop-propagation event)
(uuc/release-action! :draw/selrect)
(uuc/release-action! :shape/movement))))
(uuc/release-all-actions!))))
(defn- text-component-did-mount
[own]

View file

@ -87,6 +87,7 @@
[own]
(letfn [(handle-scroll-interaction []
(let [stoper (->> uuc/actions-s
(rx/map :type)
(rx/filter #(not= % :scroll/viewport))
(rx/take 1))
local (:rum/local own)
@ -110,6 +111,7 @@
(let [el (mx/get-ref-dom own "workspace-canvas")
sub (as-> uuc/actions-s $
(rx/map :type $)
(rx/dedupe $)
(rx/filter #(= :scroll/viewport %) $)
(rx/on-value $ handle-scroll-interaction))]

View file

@ -88,8 +88,7 @@
(uuc/acquire-action! :draw/selrect)))
(on-mouse-up [event]
(dom/stop-propagation event)
(uuc/release-action! :draw/shape)
(uuc/release-action! :draw/selrect))]
(uuc/release-all-actions!))]
(html
[:svg.viewport {:width uuwb/viewport-width
:height uuwb/viewport-height

View file

@ -52,6 +52,7 @@
(reset! +drawing-position+ (assoc point :lock false))
(let [stoper (->> uuc/actions-s
(rx/map :type)
(rx/filter #(not= % :shape/movement))
(rx/take 1))]
(as-> wb/mouse-canvas-s $
@ -87,6 +88,7 @@
:builtin/line (init-shape shape))))]
(as-> uuc/actions-s $
(rx/map :type $)
(rx/dedupe $)
(rx/filter #(= :draw/shape %) $)
(rx/on-value $ init))))

View file

@ -20,12 +20,14 @@
(init []
(as-> uuc/actions-s $
(rx/map :type $)
(rx/filter #(not= % :shape/movement) $)
(rx/take 1 $)
(rx/take-until $ uuwb/mouse-delta-s)
(rx/on-value $ on-value)))]
(as-> uuc/actions-s $
(rx/map :type $)
(rx/dedupe $)
(rx/filter #(= :shape/movement %) $)
(rx/on-value $ init))))

View file

@ -76,6 +76,7 @@
(init []
(let [stoper (->> uuc/actions-s
(rx/map :type)
(rx/filter #(not= % :draw/selrect))
(rx/take 1))
pos @wb/mouse-viewport-a]
@ -86,6 +87,7 @@
(rx/subscribe $ on-value nil on-complete))))]
(as-> uuc/actions-s $
(rx/map :type $)
(rx/dedupe $)
(rx/filter #(= :draw/selrect %) $)
(rx/on-value $ init))))