0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-24 23:49:45 -05:00

🐛 Fix rounding error with matrices

This commit is contained in:
alonso.torres 2023-01-19 15:47:25 +01:00
parent 73658c47f3
commit 685a071e87
2 changed files with 10 additions and 2 deletions

View file

@ -238,7 +238,15 @@
points-transform-mtx
(gmt/translate-matrix center)))
transform-inverse (when transform (gmt/inverse transform))]
transform-inverse (when transform (gmt/inverse transform))
;; There is a rounding error when the matrix returned have float point values
;; when the matrix is unit we return a "pure" matrix so we don't accumulate
;; rounding problems
[transform transform-inverse]
(if (gmt/unit? transform)
[(gmt/matrix) (gmt/matrix)]
[transform transform-inverse])]
[sr transform transform-inverse]))

View file

@ -219,7 +219,7 @@
result
(let [[id text-modifier] (first modifiers)]
(recur (rest modifiers)
(update result id apply-text-modifier text-modifier))))))
(d/update-when result id apply-text-modifier text-modifier))))))
#_(defn apply-path-modifiers
[objects path-modifiers]