diff --git a/common/src/app/common/test_helpers/composable/gen.cljc b/common/src/app/common/test_helpers/composable/gen.cljc index b5f4224a56..714e82e073 100644 --- a/common/src/app/common/test_helpers/composable/gen.cljc +++ b/common/src/app/common/test_helpers/composable/gen.cljc @@ -814,18 +814,13 @@ (n/edit-grid target :cell (assoc (select-keys cell [:row :column]) :props props))) (:transform :library-transform) (let [action (nth [:move :width :height :rotate :flip-x :flip-y] (mod (or (nth tuple 2 nil) 0) 6)) - value (or (nth tuple 3 nil) 0) - shape (:shape selected)] - ;; resizing a copy bool stays out until its - ;; stored orientation is reliable (F518) - (when-not (and (#{:width :height} action) - (= :bool (:type shape)) (:shape-ref shape)) - (n/transform-shape target action - (case action - :move [(* 5 (inc (mod value 4))) (* -3 (inc (mod value 3)))] - (:width :height) (+ 80 (* 20 (mod value 6))) - :rotate (* 45 (inc (mod value 4))) - nil)))) + value (or (nth tuple 3 nil) 0)] + (n/transform-shape target action + (case action + :move [(* 5 (inc (mod value 4))) (* -3 (inc (mod value 3)))] + (:width :height) (+ 80 (* 20 (mod value 6))) + :rotate (* 45 (inc (mod value 4))) + nil))) :library-edit (n/change-property target property value) :library-add-child (n/add-child target (keyword (str "library-generated-" (count (:applied situation)))) :width 20 :height 20 :x 10 :y 10) diff --git a/common/test/common_tests/logic/composable_gen_test.cljc b/common/test/common_tests/logic/composable_gen_test.cljc index 549347b0e8..11521f0545 100644 --- a/common/test/common_tests/logic/composable_gen_test.cljc +++ b/common/test/common_tests/logic/composable_gen_test.cljc @@ -2612,6 +2612,18 @@ [:rotate 23 0 0 0] [:style 26 29 1] [:combine 25 0 0 0] [:variant-property 0 0 0 0] [:switch 16]]})))) +(t/deftest a-flipped-turned-copy-switches-without-losing-its-geometry + (t/is (map? (cg/run {:world [2 2 {:variants true :text-styles true :layout nil :variant-diff false + :layout-item-margins false :grid-square false :rich-variants true + :layout-children false :grid-empty false :layout-copies true :text true}] + :ops [[:transform 0 4 0 17] [:rotate 0 0 0 0] [:switch 0]]})))) + +(t/deftest a-turned-pushed-copy-made-a-variant-keeps-a-valid-file + (t/is (map? (cg/run {:world [3 2 {:variants true :text-styles true :layout nil :variant-diff false + :layout-item-margins false :grid-square false :rich-variants true + :layout-children false :grid-empty false :layout-copies true :text true}] + :ops [[:rotate 7 0 0 0] [:update-main 0 0 0 0] [:make-variant 19 0 0 0] [:style 0 29 4 0]]})))) + (t/deftest settling-a-bool-in-a-grid-copy-twice-keeps-its-shapes-in-place (t/is (map? (cg/run {:world [3 0 {:variants true :rich-variants true :text true :layout :grid :layout-copies true :layout-children true}]