From aed065eec18a943d3f042e70ca2d70797d5d338a Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Wed, 21 Sep 2022 08:43:21 +0200 Subject: [PATCH] :bug: Fix using gradient for shadow fill --- frontend/src/app/main/data/workspace/colors.cljs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frontend/src/app/main/data/workspace/colors.cljs b/frontend/src/app/main/data/workspace/colors.cljs index 220567307..f40a5e1c5 100644 --- a/frontend/src/app/main/data/workspace/colors.cljs +++ b/frontend/src/app/main/data/workspace/colors.cljs @@ -243,7 +243,10 @@ ptk/WatchEvent (watch [_ _ _] (rx/of (dch/update-shapes ids (fn [shape] - (let [new-attrs (merge (get-in shape [:shadow index :color]) attrs)] + (let [;; If we try to set a gradient to a shadow (for example using the color selection from multiple shapes) let's use the first stop color + attrs (cond-> attrs + (:gradient attrs) (get-in [:gradient :stops 0])) + new-attrs (merge (get-in shape [:shadow index :color]) attrs)] (assoc-in shape [:shadow index :color] new-attrs)))))))) (defn add-stroke