mirror of
https://github.com/penpot/penpot.git
synced 2025-08-03 02:18:28 +02:00
✨ Fix editor and bounds for new texts
This commit is contained in:
parent
1c2785f34e
commit
18dded1a00
5 changed files with 165 additions and 61 deletions
|
@ -190,3 +190,20 @@
|
|||
(multiply mtx)
|
||||
(translate (gpt/negate pt)))
|
||||
mtx))
|
||||
|
||||
(defn determinant
|
||||
"Determinant for the affinity transform"
|
||||
[{:keys [a b c d _ _]}]
|
||||
(- (* a d) (* c b)))
|
||||
|
||||
(defn inverse
|
||||
"Gets the inverse of the affinity transform `mtx`"
|
||||
[{:keys [a b c d e f] :as mtx}]
|
||||
(let [det (determinant mtx)
|
||||
a' (/ d det)
|
||||
b' (/ (- b) det)
|
||||
c' (/ (- c) det)
|
||||
d' (/ a det)
|
||||
e' (/ (- (* c f) (* d e)) det)
|
||||
f' (/ (- (* b e) (* a f)) det)]
|
||||
(Matrix. a' b' c' d' e' f')))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue