diff --git a/common/src/app/common/logic/libraries.cljc b/common/src/app/common/logic/libraries.cljc index 2c781aa426..f4ffb6072c 100644 --- a/common/src/app/common/logic/libraries.cljc +++ b/common/src/app/common/logic/libraries.cljc @@ -780,11 +780,11 @@ :root-main root-main ;; An orientation the copy root inherits places it ;; and is not pushed into the main. Sync composes a - ;; nested root with its parent's turn; a top copy - ;; root owns its turn only when it authors geometry. - :inherited-turn (if (:component-root shape-inst) - (when-not (ctk/touched-group? shape-inst :geometry-group) - (orient-like shape-inst root-main center)) + ;; root with its parent's turn; a top copy root that + ;; does not author its geometry inherits all of it. + :inherited-turn (if (and (:component-root shape-inst) + (not (ctk/touched-group? shape-inst :geometry-group))) + (orient-like shape-inst root-main center) (when-let [parent (ctn/get-shape container (:parent-id shape-inst))] (orient-like parent (or (ctn/get-shape main-container (:parent-id root-main)) {}) diff --git a/common/test/common_tests/logic/composable_gen_test.cljc b/common/test/common_tests/logic/composable_gen_test.cljc index 13441cae57..9573d89976 100644 --- a/common/test/common_tests/logic/composable_gen_test.cljc +++ b/common/test/common_tests/logic/composable_gen_test.cljc @@ -1004,3 +1004,11 @@ :layout-copies true :text true}] :ops [[:nest 0 0 0 0] [:text-style 0 1 1] [:duplicate 0 0 0 0] [:update-main 1 0 0 0] [:text-style 0 0 1]]})))) + +(t/deftest generated-resized-copy-in-a-turned-board-pushes-its-own-turn + ;; a copy turned with a board that is detached and then resized pushes its + ;; size to its main but not the board's turn, which sync gives it back + (t/is (map? (cg/run {:world [2 2 {:variants true :text-styles true :library true :rich-variants true + :layout-copies true :text true}] + :ops [[:rotate 15 0 0 0] [:detach 15 0 0 0] [:delete 5] [:restore 5] + [:resize 14 0 0 0] [:edit 3 0 1 1] [:update-main 3]]}))))