diff --git a/CHANGES.md b/CHANGES.md index 724ef91fc..c98bdacfe 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -9,6 +9,7 @@ - Consolidate adding share button to workspace - Fix problem when pasting text [Taiga #9929](https://tree.taiga.io/project/penpot/issue/9929) - Fix incorrect media reference handling on component instantiation +- Fix stroke color change with a simple color over old library color [Taiga #9963](https://tree.taiga.io/project/penpot/issue/9963) ## 2.4.2 diff --git a/frontend/src/app/main/data/workspace/colors.cljs b/frontend/src/app/main/data/workspace/colors.cljs index da8053ab9..1eb22a3da 100644 --- a/frontend/src/app/main/data/workspace/colors.cljs +++ b/frontend/src/app/main/data/workspace/colors.cljs @@ -251,6 +251,14 @@ (contains? attrs :file-id) (assoc :stroke-color-ref-file (:file-id attrs)) + ;; These nils will be remove before updating the shape + ;; but old refs to library colors will be removed as well + (not (contains? attrs :id)) + (assoc :stroke-color-ref-id nil) + + (not (contains? attrs :file-id)) + (assoc :stroke-color-ref-file nil) + (contains? attrs :gradient) (assoc :stroke-color-gradient (:gradient attrs)) @@ -279,6 +287,7 @@ (not (contains? new-attrs :stroke-alignment)) (assoc :stroke-alignment :center) + ;; Nils added to clean library colors are removed here :always (d/without-nils))] (cond-> shape