mirror of
https://github.com/penpot/penpot.git
synced 2025-03-12 07:41:43 -05:00
✨ Improves matrix serialization
This commit is contained in:
parent
984187037c
commit
f2fd380979
1 changed files with 17 additions and 8 deletions
|
@ -19,7 +19,6 @@
|
|||
(def precision 6)
|
||||
|
||||
;; --- Matrix Impl
|
||||
|
||||
(defrecord Matrix [^double a
|
||||
^double b
|
||||
^double c
|
||||
|
@ -28,13 +27,23 @@
|
|||
^double f]
|
||||
Object
|
||||
(toString [_]
|
||||
(str "matrix("
|
||||
(mth/precision a precision) ","
|
||||
(mth/precision b precision) ","
|
||||
(mth/precision c precision) ","
|
||||
(mth/precision d precision) ","
|
||||
(mth/precision e precision) ","
|
||||
(mth/precision f precision) ")")))
|
||||
#?(:clj
|
||||
(dm/fmt "matrix(%, %, %, %, %, %)"
|
||||
(mth/precision a precision)
|
||||
(mth/precision b precision)
|
||||
(mth/precision c precision)
|
||||
(mth/precision d precision)
|
||||
(mth/precision e precision)
|
||||
(mth/precision f precision))
|
||||
|
||||
:cljs
|
||||
(dm/fmt "matrix(%, %, %, %, %, %)"
|
||||
(.toFixed a precision)
|
||||
(.toFixed b precision)
|
||||
(.toFixed c precision)
|
||||
(.toFixed d precision)
|
||||
(.toFixed e precision)
|
||||
(.toFixed f precision)))))
|
||||
|
||||
(defn matrix?
|
||||
"Return true if `v` is Matrix instance."
|
||||
|
|
Loading…
Add table
Reference in a new issue