From 2272977d678c0488898a1f6c122a9b61b3d86405 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Thu, 16 Mar 2023 17:11:46 +0100 Subject: [PATCH 1/2] :bug: Fix problem when editing gap/margins in layout --- common/src/app/common/types/modifiers.cljc | 4 ++-- frontend/src/app/main/data/workspace/transforms.cljs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/common/src/app/common/types/modifiers.cljc b/common/src/app/common/types/modifiers.cljc index 5a76d4100..6c3b3acde 100644 --- a/common/src/app/common/types/modifiers.cljc +++ b/common/src/app/common/types/modifiers.cljc @@ -309,12 +309,12 @@ (-> (or modifiers (empty)) (update :structure-child conj (scale-content-op value)))) -(defn change-property +(defn change-recursive-property [modifiers property value] (-> (or modifiers (empty)) (update :structure-child conj (change-property-op property value)))) -(defn change-parent-property +(defn change-property [modifiers property value] (-> (or modifiers (empty)) (update :structure-parent conj (change-property-op property value)))) diff --git a/frontend/src/app/main/data/workspace/transforms.cljs b/frontend/src/app/main/data/workspace/transforms.cljs index 2d07e0766..20376e402 100644 --- a/frontend/src/app/main/data/workspace/transforms.cljs +++ b/frontend/src/app/main/data/workspace/transforms.cljs @@ -184,10 +184,10 @@ (ctm/resize scalev resize-origin shape-transform shape-transform-inverse) (cond-> set-fix-width? - (ctm/change-parent-property :layout-item-h-sizing :fix)) + (ctm/change-property :layout-item-h-sizing :fix)) (cond-> set-fix-height? - (ctm/change-parent-property :layout-item-v-sizing :fix)) + (ctm/change-property :layout-item-v-sizing :fix)) (cond-> scale-text (ctm/scale-content (:x scalev)))) From 120d3005ea5747ad3656317a3d60034a2180cb5a Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Thu, 16 Mar 2023 17:39:11 +0100 Subject: [PATCH 2/2] :bug: Fix change layer index when moving absolute positioned shape --- frontend/src/app/main/data/workspace/transforms.cljs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/frontend/src/app/main/data/workspace/transforms.cljs b/frontend/src/app/main/data/workspace/transforms.cljs index 20376e402..8c4a297b5 100644 --- a/frontend/src/app/main/data/workspace/transforms.cljs +++ b/frontend/src/app/main/data/workspace/transforms.cljs @@ -739,6 +739,13 @@ #{} (into (d/ordered-set) (find-all-empty-parents #{}))) + ;; Not move absolute shapes that won't change parent + moving-shapes + (->> moving-shapes + (remove (fn [shape] + (and (ctl/layout-absolute? shape) + (= frame-id (:parent-id shape)))))) + changes (-> (pcb/empty-changes it page-id) (pcb/with-objects objects)