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:
parent
3fdcea78e4
commit
5d689551e3
1 changed files with 8 additions and 6 deletions
|
@ -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
|
||||||
|
@ -302,7 +304,7 @@
|
||||||
|
|
||||||
:else
|
:else
|
||||||
(-> shape
|
(-> shape
|
||||||
(merge rect-shape)))]
|
(merge rect-shape)))]
|
||||||
(as-> shape $
|
(as-> shape $
|
||||||
(update $ :transform #(gmt/multiply (or % (gmt/matrix)) matrix))
|
(update $ :transform #(gmt/multiply (or % (gmt/matrix)) matrix))
|
||||||
(update $ :transform-inverse #(gmt/multiply matrix-inverse (or % (gmt/matrix))))
|
(update $ :transform-inverse #(gmt/multiply matrix-inverse (or % (gmt/matrix))))
|
||||||
|
|
Loading…
Add table
Reference in a new issue