From ad4c1aae458f17113cce5e78e05247faa0d224bc Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Fri, 11 Mar 2022 12:56:07 +0100 Subject: [PATCH] :bug: Fix problem with flip rotations --- frontend/src/app/main/data/workspace/transforms.cljs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/frontend/src/app/main/data/workspace/transforms.cljs b/frontend/src/app/main/data/workspace/transforms.cljs index b38f90773f..9ae522ead3 100644 --- a/frontend/src/app/main/data/workspace/transforms.cljs +++ b/frontend/src/app/main/data/workspace/transforms.cljs @@ -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))