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

Fix deref impl on matrix.

This commit is contained in:
Andrey Antukh 2016-02-06 17:37:26 +02:00
parent 5d5b84a0a1
commit 5df6e6397d

View file

@ -1,5 +1,6 @@
(ns uxbox.util.geom.matrix
(:require [uxbox.util.math :as mth]
(:require [cuerdas.core :as str]
[uxbox.util.math :as mth]
[uxbox.util.geom.point :as gpt]))
(defrecord Matrix [a b c d tx ty])
@ -11,7 +12,12 @@
(extend-type Matrix
cljs.core/IDeref
(-deref [v]
(mapv #(get v %) [:a :b :c :d :tx :ty])))
(mapv #(get v %) [:a :c :b :d :tx :ty]))
Object
(toString [v]
(->> (str/join "," @v)
(str/format "matrix(%s)"))))
(extend-protocol ICoerce
nil