From ecc93d9246f8d6fa5e2c5deb106b2a7c17cf70dc Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Thu, 10 Oct 2024 10:29:19 +0200 Subject: [PATCH] :bug: Fix problem with precision on boolean calculation --- CHANGES.md | 1 + common/src/app/common/geom/shapes/path.cljc | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 7585439d6c..ee9234f581 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -32,6 +32,7 @@ - Fix a regression with feedback form subject and content limits [Taiga #8908](https://tree.taiga.io/project/penpot/issue/8908) - Fix problem with stroke and filter ordering in frames [Github #5058](https://github.com/penpot/penpot/issues/5058) - Fix problem with hover layers when hidden/blocked [Github #5074](https://github.com/penpot/penpot/issues/5074) +- Fix problem with precision on boolean calculation [Taig #8482](https://tree.taiga.io/project/penpot/issue/8482) ## 2.2.1 diff --git a/common/src/app/common/geom/shapes/path.cljc b/common/src/app/common/geom/shapes/path.cljc index aaaf9dc3e8..c9863d9f3d 100644 --- a/common/src/app/common/geom/shapes/path.cljc +++ b/common/src/app/common/geom/shapes/path.cljc @@ -852,8 +852,10 @@ (defn ray-overlaps? [ray-point {selrect :selrect}] - (and (>= (:y ray-point) (:y1 selrect)) - (<= (:y ray-point) (:y2 selrect)))) + (and (or (> (:y ray-point) (:y1 selrect)) + (mth/almost-zero? (- (:y ray-point) (:y1 selrect)))) + (or (< (:y ray-point) (:y2 selrect)) + (mth/almost-zero? (- (:y ray-point) (:y2 selrect)))))) (defn content->geom-data [content]