diff --git a/CHANGES.md b/CHANGES.md index 54c9439516..497e4a1101 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -150,6 +150,7 @@ - Remove button after import process finish [Taiga #2215](https://tree.taiga.io/project/penpot/issue/2215) - Fix problem with styles in the viewer [Taiga #2467](https://tree.taiga.io/project/penpot/issue/2467) - Fix default state in viewer [Taiga #2465](https://tree.taiga.io/project/penpot/issue/2465) +- Fix division by zero in bool operation [Taiga #2349](https://tree.taiga.io/project/penpot/issue/2349) ### :heart: Community contributions by (Thank you!) diff --git a/common/src/app/common/geom/shapes/path.cljc b/common/src/app/common/geom/shapes/path.cljc index 062f4ea46b..b9fc403ba4 100644 --- a/common/src/app/common/geom/shapes/path.cljc +++ b/common/src/app/common/geom/shapes/path.cljc @@ -119,7 +119,9 @@ ;; normalize value d (mth/sqrt (+ (* x x) (* y y)))] - (gpt/point (/ x d) (/ y d)))) + (if (mth/almost-zero? d) + (gpt/point 0 0) + (gpt/point (/ x d) (/ y d))))) (defn curve-windup [curve t]