From 9856da4a1f0523df8992956e699ab85e1c777901 Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Thu, 21 Apr 2022 14:16:44 +0200 Subject: [PATCH] :bug: Fix black background while drawing a path --- frontend/src/app/main/ui/shapes/custom_stroke.cljs | 8 ++++++++ frontend/src/app/main/ui/workspace/viewport/drawarea.cljs | 4 +--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/frontend/src/app/main/ui/shapes/custom_stroke.cljs b/frontend/src/app/main/ui/shapes/custom_stroke.cljs index 84c8726d1..9debee882 100644 --- a/frontend/src/app/main/ui/shapes/custom_stroke.cljs +++ b/frontend/src/app/main/ui/shapes/custom_stroke.cljs @@ -382,6 +382,14 @@ (some? style) (obj/set! "style" style))) + (and (= :path (:type shape)) (empty? (:fills shape))) + (let [style + (-> (obj/get props "style") + (obj/clone) + (obj/set! "fill" "none"))] + (-> props + (obj/set! "style" style))) + :else props))) diff --git a/frontend/src/app/main/ui/workspace/viewport/drawarea.cljs b/frontend/src/app/main/ui/workspace/viewport/drawarea.cljs index ae66a748f..2ab39b52d 100644 --- a/frontend/src/app/main/ui/workspace/viewport/drawarea.cljs +++ b/frontend/src/app/main/ui/workspace/viewport/drawarea.cljs @@ -11,7 +11,6 @@ [app.common.math :as mth] [app.main.ui.shapes.path :refer [path-shape]] [app.main.ui.workspace.shapes :as shapes] - [app.main.ui.workspace.shapes.path.common :as pc] [app.main.ui.workspace.shapes.path.editor :refer [path-editor]] [rumext.alpha :as mf])) @@ -23,8 +22,7 @@ [:g.draw-area [:g {:style {:pointer-events "none"}} - [:& shapes/shape-wrapper {:shape (-> (gsh/transform-shape shape) - (assoc :fills [{:fill-color pc/white-color :fill-opacity 0}]))}]] + [:& shapes/shape-wrapper {:shape (gsh/transform-shape shape)}]] (case tool :path [:& path-editor {:shape shape :zoom zoom}]