From dfb1a79179d6dbb6010a07f795ad2dc14803ca1b Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Mon, 10 Apr 2023 16:51:05 +0200 Subject: [PATCH] :bug: Fix problem when closing paths for big imported SVGs --- common/src/app/common/geom/shapes/path.cljc | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/common/src/app/common/geom/shapes/path.cljc b/common/src/app/common/geom/shapes/path.cljc index 830e98e769..bce132b4bb 100644 --- a/common/src/app/common/geom/shapes/path.cljc +++ b/common/src/app/common/geom/shapes/path.cljc @@ -983,10 +983,12 @@ (defn open-path? [shape] - - (and (= :path (:type shape)) - (not (->> shape - :content - (sp/close-subpaths) - (sp/get-subpaths) - (every? sp/is-closed?))))) + (let [svg? (contains? shape :svg-attrs) + ;; No close subpaths for svgs imported + maybe-close (if svg? identity sp/close-subpaths)] + (and (= :path (:type shape)) + (not (->> shape + :content + (maybe-close) + (sp/get-subpaths) + (every? sp/is-closed?))))))