From 188f5c616716b6206bbe91db03a2b1f350f299d9 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Wed, 31 Jan 2024 13:05:02 +0100 Subject: [PATCH] :bug: Fix problem with snap points --- common/src/app/common/geom/snap.cljc | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/common/src/app/common/geom/snap.cljc b/common/src/app/common/geom/snap.cljc index ff35d16743..a2cffe09f1 100644 --- a/common/src/app/common/geom/snap.cljc +++ b/common/src/app/common/geom/snap.cljc @@ -15,15 +15,16 @@ (defn rect->snap-points [rect] - (let [x (dm/get-prop rect :x) - y (dm/get-prop rect :y) - w (dm/get-prop rect :width) - h (dm/get-prop rect :height)] - #{(gpt/point x y) - (gpt/point (+ x w) y) - (gpt/point (+ x w) (+ y h)) - (gpt/point x (+ y h)) - (grc/rect->center rect)})) + (when (some? rect) + (let [x (dm/get-prop rect :x) + y (dm/get-prop rect :y) + w (dm/get-prop rect :width) + h (dm/get-prop rect :height)] + #{(gpt/point x y) + (gpt/point (+ x w) y) + (gpt/point (+ x w) (+ y h)) + (gpt/point x (+ y h)) + (grc/rect->center rect)}))) (defn- frame->snap-points [frame]