From b8a83a34796318f43658e6580146304386662f2b Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Fri, 21 Oct 2022 12:44:43 +0200 Subject: [PATCH] :bug: Fixed problem with snap to pixel --- common/src/app/common/geom/shapes/modifiers.cljc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/common/src/app/common/geom/shapes/modifiers.cljc b/common/src/app/common/geom/shapes/modifiers.cljc index cd8a1ab02..d777d93be 100644 --- a/common/src/app/common/geom/shapes/modifiers.cljc +++ b/common/src/app/common/geom/shapes/modifiers.cljc @@ -21,7 +21,8 @@ "Adjust modifiers so they adjust to the pixel grid" [modifiers shape] - (if (some? (:resize-transform modifiers)) + (if (and (some? (:resize-transform modifiers)) + (not (gmt/unit? (:resize-transform modifiers)))) ;; If we're working with a rotation we don't handle pixel precision because ;; the transformation won't have the precision anyway modifiers @@ -243,7 +244,10 @@ (let [set-modifiers (fn [modif-tree id] - (assoc modif-tree id {:modifiers (get-modifier (get objects id))})) + (let [shape (get objects id) + modifiers (cond-> (get-modifier shape) snap-pixel? (set-pixel-precision shape))] + (-> modif-tree + (assoc id {:modifiers modifiers})))) modif-tree (reduce set-modifiers {} ids)