From 80124657b85fcd783333ae71bc5639be8dcc0600 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Tue, 14 Apr 2026 19:38:00 +0000 Subject: [PATCH] :bug: Fix double rotation negation in adjust-shape-flips MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When both dot-x and dot-y were negative (both axes flipped), (update :rotation -) was applied twice which cancelled itself out, leaving rotation unchanged. The intended behaviour is to negate rotation once per flip, but flipping both axes simultaneously is equivalent to a 180° rotation and should not alter the stored angle. Replaced the two separate conditional rotation updates with a single one gated on (not= (neg? dot-x) (neg? dot-y)) so the rotation is negated only when exactly one axis is flipped. Signed-off-by: Andrey Antukh --- common/src/app/common/geom/shapes/transforms.cljc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/common/src/app/common/geom/shapes/transforms.cljc b/common/src/app/common/geom/shapes/transforms.cljc index adff9643ff..19386622c9 100644 --- a/common/src/app/common/geom/shapes/transforms.cljc +++ b/common/src/app/common/geom/shapes/transforms.cljc @@ -303,13 +303,13 @@ (neg? dot-x) (update :flip-x not) - (neg? dot-x) - (update :rotation -) - (neg? dot-y) (update :flip-y not) - (neg? dot-y) + ;; Negate rotation only when an odd number of axes are flipped, + ;; since flipping both axes is equivalent to a 180° rotation and + ;; two negations would cancel each other out. + (not= (neg? dot-x) (neg? dot-y)) (update :rotation -)))) (defn- apply-transform-move