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

Add missing arity for transform method.

This commit is contained in:
Andrey Antukh 2016-02-05 18:26:24 +02:00
parent 1abc0e4239
commit f406ec2621

View file

@ -78,7 +78,10 @@
(defn translate
"Apply translate transformation to the matrix."
[m pt]
(assoc m
:tx (+ (:tx m) (* (:x pt) (:a m)) (* (:y pt) (:b m)))
:ty (+ (:ty m) (* (:x pt) (:c m)) (* (:y pt) (:d m)))))
([m pt]
(let [pt (gpt/-point pt)]
(assoc m
:tx (+ (:tx m) (* (:x pt) (:a m)) (* (:y pt) (:b m)))
:ty (+ (:ty m) (* (:x pt) (:c m)) (* (:y pt) (:d m))))))
([m x y]
(translate m (gpt/point x y))))