🐛 Fix different behaviour during image drag

This commit is contained in:
Alejandro Alonso 2022-04-21 07:10:44 +02:00 committed by Alonso Torres
parent 9e940dc042
commit 08c6e9b702
4 changed files with 9 additions and 4 deletions

View file

@ -160,8 +160,8 @@
;; This stream checks the consecutive mouse positions to do the dragging
(->> points
(streams/move-points-stream snap-toggled start-position selected-points)
(rx/take-until stopper)
(rx/map #(move-selected-path-point start-position %)))
(rx/map #(move-selected-path-point start-position %))
(rx/take-until stopper))
(rx/of (apply-content-modifiers)))))))
(defn- get-displacement

View file

@ -7,6 +7,7 @@
(ns app.main.ui.workspace.shapes.path
(:require
[app.common.path.commands :as upc]
[app.main.data.workspace.path.helpers :as helpers]
[app.main.refs :as refs]
[app.main.ui.shapes.path :as path]
[app.main.ui.shapes.shape :refer [shape-container]]
@ -21,7 +22,11 @@
content-modifiers (mf/deref content-modifiers-ref)
editing-id (mf/deref refs/selected-edition)
editing? (= editing-id (:id shape))
shape (update shape :content upc/apply-content-modifiers content-modifiers)]
shape (update shape :content upc/apply-content-modifiers content-modifiers)
[_ new-selrect]
(helpers/content->points+selrect shape (:content shape))
shape (assoc shape :selrect new-selrect)]
[:> shape-container {:shape shape
:pointer-events (when editing? "none")}