From 302750bd7e614e72aabfc3fb2a910661ebb81dc3 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Tue, 4 Jul 2023 10:48:28 +0200 Subject: [PATCH] :bug: Fix issue with paths line to curve and concurrent editing --- CHANGES.md | 1 + common/src/app/common/path/commands.cljc | 15 +++++++++------ frontend/src/app/util/path/format.cljs | 2 +- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index c1917880f..4e7d3a38d 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -32,6 +32,7 @@ - Fix graphic item rename on assets pannel [Taiga #5556](https://tree.taiga.io/project/penpot/issue/5556) - Fix component and media name validation on assets panel [Taiga #5555](https://tree.taiga.io/project/penpot/issue/5555) - Fix problem with selection shortcuts [Taiga #5492](https://tree.taiga.io/project/penpot/issue/5492) +- Fix issue with paths line to curve and concurrent editing [Taiga #5191](https://tree.taiga.io/project/penpot/issue/5191) ### :heart: Community contributions by (Thank you!) diff --git a/common/src/app/common/path/commands.cljc b/common/src/app/common/path/commands.cljc index 7a02f6ec4..a434cb09e 100644 --- a/common/src/app/common/path/commands.cljc +++ b/common/src/app/common/path/commands.cljc @@ -50,12 +50,15 @@ (defn update-curve-to [command h1 h2] - (-> command - (assoc :command :curve-to) - (assoc-in [:params :c1x] (:x h1)) - (assoc-in [:params :c1y] (:y h1)) - (assoc-in [:params :c2x] (:x h2)) - (assoc-in [:params :c2y] (:y h2)))) + (let [params {:x (-> command :params :x) + :y (-> command :params :y) + :c1x (:x h1) + :c1y (:y h1) + :c2x (:x h2) + :c2y (:y h2)}] + (-> command + (assoc :command :curve-to) + (assoc :params params)))) (defn make-curve-to [to h1 h2] diff --git a/frontend/src/app/util/path/format.cljs b/frontend/src/app/util/path/format.cljs index f7628bc33..c0d38829d 100644 --- a/frontend/src/app/util/path/format.cljs +++ b/frontend/src/app/util/path/format.cljs @@ -72,7 +72,7 @@ :curve-to (let [{:keys [c1x c1y c2x c2y]} params] - (join-params c1x c1y c2x c2y x y)) + (join-params (or c1x x) (or c1y y) (or c2x x) (or c2y y) x y)) (:smooth-curve-to :quadratic-bezier-curve-to) (let [{:keys [cx cy]} params]