From 553c0e6d6a12697de5a983c2c1476e15b8de21b7 Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Thu, 10 Mar 2022 16:34:55 +0100 Subject: [PATCH] :bug: Fixing select color for stroke from palette --- frontend/src/app/main/data/workspace/colors.cljs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/frontend/src/app/main/data/workspace/colors.cljs b/frontend/src/app/main/data/workspace/colors.cljs index 5e132559c..f677aee8f 100644 --- a/frontend/src/app/main/data/workspace/colors.cljs +++ b/frontend/src/app/main/data/workspace/colors.cljs @@ -263,7 +263,17 @@ attrs (merge attrs color-attrs)] (rx/of (dch/update-shapes ids (fn [shape] - (assoc-in shape [:strokes index] (merge (get-in shape [:strokes index]) attrs))))))))) + (let [new-attrs (merge (get-in shape [:strokes index]) attrs) + new-attrs (cond-> new-attrs + (not (contains? new-attrs :stroke-width)) + (assoc :stroke-width 1) + + (not (contains? new-attrs :stroke-style)) + (assoc :stroke-style :solid) + + (not (contains? new-attrs :stroke-alignment)) + (assoc :stroke-alignment :center))] + (assoc-in shape [:strokes index] new-attrs))))))))) (defn add-stroke [ids stroke]