mirror of
https://github.com/penpot/penpot.git
synced 2025-06-11 04:41:39 +02:00
🐛 Fix rounding error with matrices
This commit is contained in:
parent
73658c47f3
commit
685a071e87
2 changed files with 10 additions and 2 deletions
|
@ -238,7 +238,15 @@
|
||||||
points-transform-mtx
|
points-transform-mtx
|
||||||
(gmt/translate-matrix center)))
|
(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]))
|
[sr transform transform-inverse]))
|
||||||
|
|
||||||
|
|
|
@ -219,7 +219,7 @@
|
||||||
result
|
result
|
||||||
(let [[id text-modifier] (first modifiers)]
|
(let [[id text-modifier] (first modifiers)]
|
||||||
(recur (rest 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
|
#_(defn apply-path-modifiers
|
||||||
[objects path-modifiers]
|
[objects path-modifiers]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue