0
Fork 0
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:
Andrey Antukh 2016-08-12 20:39:31 +03:00
parent 3977748e34
commit 5fd1e7f030
No known key found for this signature in database
GPG key ID: 4DFEBCB8316A8B95

View file

@ -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)))