diff --git a/common/src/app/common/logic/shapes.cljc b/common/src/app/common/logic/shapes.cljc index 293a89d3d0..4e6e78b50e 100644 --- a/common/src/app/common/logic/shapes.cljc +++ b/common/src/app/common/logic/shapes.cljc @@ -566,7 +566,7 @@ (-> changes ;; Remove layout-item properties and tokens when moving a shape outside a layout (cond-> (not (ctl/any-layout? parent)) - (-> (pcb/update-shapes ids ctl/remove-layout-item-data) + (-> (pcb/update-shapes ids ctl/remove-layout-item-data {:ignore-touched true}) (pcb/update-shapes ids cto/unapply-layout-item-tokens))) ;; Hide in the viewer the boards moved into a board diff --git a/common/test/common_tests/logic/composable_gen_test.cljc b/common/test/common_tests/logic/composable_gen_test.cljc index 659e694260..dc6a431f96 100644 --- a/common/test/common_tests/logic/composable_gen_test.cljc +++ b/common/test/common_tests/logic/composable_gen_test.cljc @@ -958,3 +958,10 @@ :library-depth 1 :library true :rich-variants true :library-text true :layout-copies true :text true}] :ops [[:rotate 1 0 0 0] [:switch 3 0 0 0]]})))) + +(t/deftest generated-copy-moved-out-of-a-layout-loses-its-margins-without-an-override + ;; a copy whose margin type a reset kept is nested out of its flex parent; + ;; leaving the layout clears its margins, which is no override + (t/is (map? (cg/run {:world [2 1 {:text true :text-styles true :layout :flex :layout-children true}] + :ops [[:remove-child 0 0 0 0] [:nest 0 0 0 0] [:style 2 27 1] + [:edit 0 1 1 :copy-head] [:reset 0] [:nest 0 0 0 0]]}))))