From 08c6e9b7022f5acd1ef152bb491633feeaeaec29 Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Thu, 21 Apr 2022 07:10:44 +0200 Subject: [PATCH] :bug: Fix different behaviour during image drag --- CHANGES.md | 1 + common/src/app/common/path/commands.cljc | 1 - frontend/src/app/main/data/workspace/path/edition.cljs | 4 ++-- frontend/src/app/main/ui/workspace/shapes/path.cljs | 7 ++++++- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index ef25749a0..90b6c452f 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -45,6 +45,7 @@ ### :bug: Bugs fixed +- Fix different behaviour during image drag [Taiga #2279](https://tree.taiga.io/project/penpot/issue/2279) - Fix hidden file name on import [Taiga #3172](https://tree.taiga.io/project/penpot/issue/3172) - Fix unneccessary scrollbars at the color list [Taiga #3211](https://tree.taiga.io/project/penpot/issue/3211) - "Show in exports" is showing in multiselections [Taiga #3194](https://tree.taiga.io/project/penpot/issue/3194) diff --git a/common/src/app/common/path/commands.cljc b/common/src/app/common/path/commands.cljc index a79b34676..5bae5862b 100644 --- a/common/src/app/common/path/commands.cljc +++ b/common/src/app/common/path/commands.cljc @@ -98,7 +98,6 @@ (let [content (if (vector? content) content (into [] content))] (reduce apply-to-index content modifiers)))) - (defn get-handler [{:keys [params] :as command} prefix] (let [cx (d/prefix-keyword prefix :x) cy (d/prefix-keyword prefix :y)] diff --git a/frontend/src/app/main/data/workspace/path/edition.cljs b/frontend/src/app/main/data/workspace/path/edition.cljs index 4eb4763de..fa8c00f51 100644 --- a/frontend/src/app/main/data/workspace/path/edition.cljs +++ b/frontend/src/app/main/data/workspace/path/edition.cljs @@ -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 diff --git a/frontend/src/app/main/ui/workspace/shapes/path.cljs b/frontend/src/app/main/ui/workspace/shapes/path.cljs index a245d5bb2..dee228b39 100644 --- a/frontend/src/app/main/ui/workspace/shapes/path.cljs +++ b/frontend/src/app/main/ui/workspace/shapes/path.cljs @@ -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")}