mirror of
https://github.com/penpot/penpot.git
synced 2026-09-12 23:19:28 +00:00
🎉 Add proper pprint for matrix and point types.
This commit is contained in:
parent
33c25bfe6d
commit
9d7a814180
@ -9,6 +9,8 @@
|
|||||||
|
|
||||||
(ns app.common.geom.matrix
|
(ns app.common.geom.matrix
|
||||||
(:require
|
(:require
|
||||||
|
#?(:cljs [cljs.pprint :as pp]
|
||||||
|
:clj [clojure.pprint :as pp])
|
||||||
[app.common.math :as mth]
|
[app.common.math :as mth]
|
||||||
[app.common.geom.point :as gpt]))
|
[app.common.geom.point :as gpt]))
|
||||||
|
|
||||||
@ -130,3 +132,5 @@
|
|||||||
(th-eq m1d m2d)
|
(th-eq m1d m2d)
|
||||||
(th-eq m1e m2e)
|
(th-eq m1e m2e)
|
||||||
(th-eq m1f m2f))))
|
(th-eq m1f m2f))))
|
||||||
|
|
||||||
|
(defmethod pp/simple-dispatch Matrix [obj] (pr obj))
|
||||||
|
|||||||
@ -10,6 +10,8 @@
|
|||||||
(ns app.common.geom.point
|
(ns app.common.geom.point
|
||||||
(:refer-clojure :exclude [divide min max])
|
(:refer-clojure :exclude [divide min max])
|
||||||
(:require
|
(:require
|
||||||
|
#?(:cljs [cljs.pprint :as pp]
|
||||||
|
:clj [clojure.pprint :as pp])
|
||||||
#?(:cljs [cljs.core :as c]
|
#?(:cljs [cljs.core :as c]
|
||||||
:clj [clojure.core :as c])
|
:clj [clojure.core :as c])
|
||||||
[app.common.math :as mth]))
|
[app.common.math :as mth]))
|
||||||
@ -245,3 +247,8 @@
|
|||||||
(- (* y2 x1))))
|
(- (* y2 x1))))
|
||||||
dist (distance line-point2 line-point1)]
|
dist (distance line-point2 line-point1)]
|
||||||
(/ num dist)))
|
(/ num dist)))
|
||||||
|
|
||||||
|
|
||||||
|
;; --- Debug
|
||||||
|
|
||||||
|
(defmethod pp/simple-dispatch Point [obj] (pr obj))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user