mirror of
https://github.com/penpot/penpot.git
synced 2025-02-04 13:29:14 -05:00
Add transform point function.
Will be used for path edition.
This commit is contained in:
parent
3977748e34
commit
5fd1e7f030
1 changed files with 8 additions and 0 deletions
|
@ -158,3 +158,11 @@
|
|||
[{:keys [x y]} decimanls]
|
||||
(Point. (mth/precision x decimanls)
|
||||
(mth/precision y decimanls)))
|
||||
|
||||
|
||||
(defn transform
|
||||
"Transform a point applying a matrix transfomation."
|
||||
[{:keys [x y] :as p} {:keys [a b c d tx ty] :as m}]
|
||||
(Point. (+ (* x a) (* y c) tx)
|
||||
(+ (* x b) (* y d) ty)))
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue