From 8032a22f14e7166e9723346d9759f151075e95d8 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Tue, 6 Feb 2024 18:34:36 +0100 Subject: [PATCH] :bug: Fix problem when moving absolute positioned shapes --- common/src/app/common/types/modifiers.cljc | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/common/src/app/common/types/modifiers.cljc b/common/src/app/common/types/modifiers.cljc index 4d893118c..7967d0379 100644 --- a/common/src/app/common/types/modifiers.cljc +++ b/common/src/app/common/types/modifiers.cljc @@ -777,14 +777,19 @@ :add-children (let [value (dm/get-prop operation :value) - index (dm/get-prop operation :index)] - (if (some? index) - (update shape :shapes - (fn [shapes] - (if (vector? shapes) - (d/insert-at-index shapes index value) - (d/concat-vec shapes value)))) - (update shape :shapes d/concat-vec value))) + index (dm/get-prop operation :index) + + shape + (if (some? index) + (update shape :shapes + (fn [shapes] + (if (vector? shapes) + (d/insert-at-index shapes index value) + (d/concat-vec shapes value)))) + (update shape :shapes d/concat-vec value))] + + ;; Remove duplication + (update shape :shapes #(into [] (apply d/ordered-set %)))) :remove-children (let [value (dm/get-prop operation :value)]