0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-03-13 00:01:51 -05:00

🐛 Fix problem with rounding

This commit is contained in:
alonso.torres 2021-05-17 16:16:27 +02:00
parent 3fdcea78e4
commit 5d689551e3

View file

@ -283,11 +283,6 @@
center center
(:width points-temp-dim) (:width points-temp-dim)
(:height points-temp-dim)) (:height points-temp-dim))
(cond-> round-coords?
(-> (update :x #(mth/precision % 0))
(update :y #(mth/precision % 0))
(update :width #(mth/precision % 0))
(update :height #(mth/precision % 0))))
(update :width max 1) (update :width max 1)
(update :height max 1)) (update :height max 1))
@ -295,6 +290,13 @@
[matrix matrix-inverse] (calculate-adjust-matrix points-temp rect-points (:flip-x shape) (:flip-y shape)) [matrix matrix-inverse] (calculate-adjust-matrix points-temp rect-points (:flip-x shape) (:flip-y shape))
rect-shape (cond-> rect-shape
round-coords?
(-> (update :x mth/round)
(update :y mth/round)
(update :width mth/round)
(update :height mth/round)))
shape (cond shape (cond
(= :path (:type shape)) (= :path (:type shape))
(-> shape (-> shape