From 500c27859b1cdcb05f17bae66fabaa5a930e1390 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Thu, 17 Apr 2025 14:37:58 +0200 Subject: [PATCH] :bug: Fix geom/point zero? predicate to work correctly with mixed numeric types Using numeric indpendent equality check: `==` --- common/src/app/common/geom/point.cljc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/common/src/app/common/geom/point.cljc b/common/src/app/common/geom/point.cljc index 88d9442c8b..a7cf2d412c 100644 --- a/common/src/app/common/geom/point.cljc +++ b/common/src/app/common/geom/point.cljc @@ -472,8 +472,10 @@ (defn zero? [p] - (and ^boolean (= 0 (dm/get-prop p :x)) - ^boolean (= 0 (dm/get-prop p :y)))) + (let [x (dm/get-prop p :x) + y (dm/get-prop p :y)] + (and ^boolean (== 0 x) + ^boolean (== 0 y)))) (defn lerp "Calculates a linear interpolation between two points given a tvalue"