From 50fd44d3f2ffa6c6c04b08cd4a1320c102aefb64 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Mon, 10 Jan 2022 15:28:28 +0100 Subject: [PATCH] :bug: Fix division by zero in bool operation --- CHANGES.md | 1 + common/src/app/common/geom/shapes/path.cljc | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) 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]