diff --git a/common/src/app/common/logic/libraries.cljc b/common/src/app/common/logic/libraries.cljc index c5212ea541..acafb8fb99 100644 --- a/common/src/app/common/logic/libraries.cljc +++ b/common/src/app/common/logic/libraries.cljc @@ -1424,11 +1424,12 @@ position-objects (get-in (meta position) [:container :objects]) ;; the head takes the place the replaced child authored placement (set/intersection (set (:touched replaced)) placement-groups) - ;; a plain copy of the position has its size, unless the replaced child authored its geometry + ;; a plain copy of the position has its size, unless the replaced child or the copy authored its geometry sized? (fn [shape] (and (= (:id shape) (:id new-head)) position (not (ctk/swapped? shape)) - (not (contains? placement :geometry-group)))) + (not (contains? placement :geometry-group)) + (not (ctk/touched-group? shape :geometry-group)))) positioned (mapv (fn [shape] (let [shape (take-position shape)] (cond-> shape (sized? shape) (sized-like position)))) diff --git a/common/test/common_tests/logic/composable_gen_test.cljc b/common/test/common_tests/logic/composable_gen_test.cljc index c0f87fb10d..0eaa626b26 100644 --- a/common/test/common_tests/logic/composable_gen_test.cljc +++ b/common/test/common_tests/logic/composable_gen_test.cljc @@ -2393,6 +2393,12 @@ :grid-empty false :layout-copies true :text false}] :ops [[:style 8 35 1] [:style 0 29 1] [:update-main]]})))) +(t/deftest updating-a-main-after-a-reset-keeps-the-size-a-switch-gave-the-copy + (t/is (map? (cg/run {:world [4 4 {:variants true :text-styles true :scale false :layout :flex :variant-diff false + :grid-square false :copies 6 :rich-variants true :layout-children false + :grid-empty false :layout-copies false :text false}] + :ops [[:resize] [:combine 1] [:add-variant] [:switch 5] [:switch] [:reset] [:update-main]]})))) + (t/deftest updating-a-main-keeps-the-max-width-override-a-switched-copy-holds (t/is (map? (cg/run {:world [3 2 {:variants true :text-styles false :layout :grid :variant-diff false :layout-item-margins false :grid-square false :rich-variants true