Remove unexpected lag on moving shape.

The lag happens when the shape is not initially selected.
This commit is contained in:
Andrey Antukh 2019-11-26 10:55:38 +01:00
parent 1357fed067
commit 792303a833
15 changed files with 106 additions and 121 deletions

View file

@ -154,10 +154,10 @@
[{:keys [shape modifiers zoom] :as props}]
(letfn [(on-mouse-down [event index]
(dom/stop-propagation event)
;; TODO: this need code ux refactor
(let [stoper (get-edition-stream-stoper)
stream (rx/take-until stoper ws/mouse-position-deltas)]
stream (->> (ws/mouse-position-deltas @ws/mouse-position)
(rx/take-until stoper))]
(when @refs/selected-alignment
(st/emit! (dw/initial-path-point-align (:id shape) index)))
(rx/subscribe stream #(on-handler-move % index))))