mirror of
https://github.com/penpot/penpot.git
synced 2025-07-18 13:07:14 +02:00
Get rid of buggy reactive locks and refactor all related code.
This commit is contained in:
parent
bce58df413
commit
b0de23b011
18 changed files with 611 additions and 516 deletions
|
@ -16,7 +16,6 @@
|
|||
[uxbox.main.data.shapes :as uds]
|
||||
[uxbox.main.ui.keyboard :as kbd]
|
||||
[uxbox.util.geom.point :as gpt]
|
||||
[uxbox.util.rlocks :as rlocks]
|
||||
[uxbox.util.dom :as dom]))
|
||||
|
||||
;; --- Refs
|
||||
|
@ -37,12 +36,13 @@
|
|||
|
||||
;; --- Movement
|
||||
|
||||
;; TODO: implement in the same way as drawing (move under uxbox.main.data.workspace.)
|
||||
|
||||
(defn start-move
|
||||
[]
|
||||
(letfn [(on-move [shape delta]
|
||||
(st/emit! (uds/apply-temporal-displacement shape delta)))
|
||||
(on-stop [{:keys [id] :as shape}]
|
||||
(rlocks/release! :shape/move)
|
||||
(st/emit! (uds/apply-displacement shape)))
|
||||
(on-start [shape]
|
||||
(let [stoper (->> streams/events
|
||||
|
@ -55,7 +55,6 @@
|
|||
(when @refs/selected-alignment
|
||||
(st/emit! (uds/initial-align-shape shape)))
|
||||
(rx/subscribe stream on-move nil on-stop)))]
|
||||
(rlocks/acquire! :shape/move)
|
||||
(run! on-start @selected-ref)))
|
||||
|
||||
;; --- Events
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue