mirror of
https://github.com/penpot/penpot.git
synced 2026-09-11 14:39:35 +00:00
✨ Properly use take-until on shape movement streams.
This commit is contained in:
parent
d06cfed50e
commit
c2f604cd01
@ -502,7 +502,6 @@
|
|||||||
stopper (rx/filter ms/mouse-up? stream)]
|
stopper (rx/filter ms/mouse-up? stream)]
|
||||||
(when-not (empty? selected)
|
(when-not (empty? selected)
|
||||||
(->> ms/mouse-position
|
(->> ms/mouse-position
|
||||||
(rx/take-until stopper)
|
|
||||||
(rx/map #(gpt/to-vec initial %))
|
(rx/map #(gpt/to-vec initial %))
|
||||||
(rx/map #(gpt/length %))
|
(rx/map #(gpt/length %))
|
||||||
(rx/filter #(> % 1))
|
(rx/filter #(> % 1))
|
||||||
@ -515,7 +514,9 @@
|
|||||||
(rx/of (start-move-duplicate initial)
|
(rx/of (start-move-duplicate initial)
|
||||||
(dws/duplicate-selected false))
|
(dws/duplicate-selected false))
|
||||||
;; Otherwise just plain old move
|
;; Otherwise just plain old move
|
||||||
(rx/of (start-move initial selected)))))))))))
|
(rx/of (start-move initial selected)))))
|
||||||
|
(rx/take-until stopper)))))))
|
||||||
|
|
||||||
|
|
||||||
(defn- start-move-duplicate
|
(defn- start-move-duplicate
|
||||||
[from-position]
|
[from-position]
|
||||||
@ -556,7 +557,6 @@
|
|||||||
delta)))
|
delta)))
|
||||||
|
|
||||||
position (->> ms/mouse-position
|
position (->> ms/mouse-position
|
||||||
(rx/take-until stopper)
|
|
||||||
(rx/with-latest-from ms/mouse-position-shift)
|
(rx/with-latest-from ms/mouse-position-shift)
|
||||||
(rx/map #(fix-axis %)))
|
(rx/map #(fix-axis %)))
|
||||||
|
|
||||||
@ -575,7 +575,8 @@
|
|||||||
(->> position
|
(->> position
|
||||||
(rx/with-latest vector snap-delta)
|
(rx/with-latest vector snap-delta)
|
||||||
(rx/map snap/correct-snap-point)
|
(rx/map snap/correct-snap-point)
|
||||||
(rx/map set-local-displacement))
|
(rx/map set-local-displacement)
|
||||||
|
(rx/take-until stopper))
|
||||||
|
|
||||||
(rx/of (set-modifiers ids)
|
(rx/of (set-modifiers ids)
|
||||||
(apply-modifiers ids)
|
(apply-modifiers ids)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user