mirror of
https://github.com/penpot/penpot.git
synced 2026-04-25 11:18:36 +00:00
🐛 Fix double rotation negation in adjust-shape-flips
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 <niwi@niwi.nz>
This commit is contained in:
parent
cf47d5e53e
commit
80124657b8
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user