0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-24 23:49:45 -05:00

🐛 Fix problem with flip rotations

This commit is contained in:
alonso.torres 2022-03-11 12:56:07 +01:00
parent 099d1259b2
commit ad4c1aae45

View file

@ -258,9 +258,17 @@
(-> (gsh/transform-bounds (:points shape) center modifiers)
(gsh/points->rect))
target-p (gpt/round (gpt/point raw-bounds))
flip-x? (neg? (get-in modifiers [:resize-vector :x]))
flip-y? (neg? (get-in modifiers [:resize-vector :y]))
target-width (max 1 (mth/round (:width raw-bounds)))
target-height (max 1 (mth/round (:height raw-bounds)))
target-p (cond-> (gpt/round (gpt/point raw-bounds))
flip-x?
(update :x + target-width)
flip-y?
(update :y + target-height))
ratio-width (/ target-width (:width raw-bounds))
ratio-height (/ target-height (:height raw-bounds))