0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-03-12 15:51:37 -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
(:width 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 :height max 1))
@ -295,6 +290,13 @@
[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
(= :path (:type shape))
(-> shape
@ -302,7 +304,7 @@
:else
(-> shape
(merge rect-shape)))]
(merge rect-shape)))]
(as-> shape $
(update $ :transform #(gmt/multiply (or % (gmt/matrix)) matrix))
(update $ :transform-inverse #(gmt/multiply matrix-inverse (or % (gmt/matrix))))