From 9d7a8141802758e803f980db069591d07f0fb6cb Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Mon, 25 Jan 2021 11:28:22 +0100 Subject: [PATCH] :tada: Add proper pprint for matrix and point types. --- common/app/common/geom/matrix.cljc | 4 ++++ common/app/common/geom/point.cljc | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/common/app/common/geom/matrix.cljc b/common/app/common/geom/matrix.cljc index 737acc78c..e071e32f3 100644 --- a/common/app/common/geom/matrix.cljc +++ b/common/app/common/geom/matrix.cljc @@ -9,6 +9,8 @@ (ns app.common.geom.matrix (:require + #?(:cljs [cljs.pprint :as pp] + :clj [clojure.pprint :as pp]) [app.common.math :as mth] [app.common.geom.point :as gpt])) @@ -130,3 +132,5 @@ (th-eq m1d m2d) (th-eq m1e m2e) (th-eq m1f m2f)))) + +(defmethod pp/simple-dispatch Matrix [obj] (pr obj)) diff --git a/common/app/common/geom/point.cljc b/common/app/common/geom/point.cljc index 7fd2fe621..01122e613 100644 --- a/common/app/common/geom/point.cljc +++ b/common/app/common/geom/point.cljc @@ -10,6 +10,8 @@ (ns app.common.geom.point (:refer-clojure :exclude [divide min max]) (:require + #?(:cljs [cljs.pprint :as pp] + :clj [clojure.pprint :as pp]) #?(:cljs [cljs.core :as c] :clj [clojure.core :as c]) [app.common.math :as mth])) @@ -245,3 +247,8 @@ (- (* y2 x1)))) dist (distance line-point2 line-point1)] (/ num dist))) + + +;; --- Debug + +(defmethod pp/simple-dispatch Point [obj] (pr obj))