From 03228a9801dbdeea655f8927fca47711be6ce1a0 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Tue, 13 Dec 2022 16:47:28 +0100 Subject: [PATCH] :bug: Fix problem with snap pixel --- common/src/app/common/geom/shapes/pixel_precision.cljc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/common/src/app/common/geom/shapes/pixel_precision.cljc b/common/src/app/common/geom/shapes/pixel_precision.cljc index f6451ab022..fa7c501317 100644 --- a/common/src/app/common/geom/shapes/pixel_precision.cljc +++ b/common/src/app/common/geom/shapes/pixel_precision.cljc @@ -32,6 +32,7 @@ ratio-width (/ target-width curr-width) ratio-height (/ target-height curr-height) scalev (gpt/point ratio-width ratio-height)] + (-> modifiers (ctm/resize scalev origin transform transform-inverse)))) @@ -41,7 +42,6 @@ corner (gpt/point bounds) target-corner (gpt/round corner) deltav (gpt/to-vec corner target-corner)] - (ctm/move modifiers deltav))) (defn set-pixel-precision @@ -56,8 +56,10 @@ has-resize? (size-pixel-precision shape points)) points - (cond-> (:points shape) - has-resize? (gco/transform-points (ctm/modifiers->transform modifiers)))] + (if has-resize? + (-> (:points shape) + (gco/transform-points (ctm/modifiers->transform modifiers)) ) + points)] [modifiers points])] (position-pixel-precision modifiers shape points)))