0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-25 07:58:49 -05:00

Merge pull request #1677 from penpot/fix-select-color-for-stroke-from-palette

🐛 Fixing select color for stroke from palette
This commit is contained in:
Alejandro 2022-03-10 17:13:02 +01:00 committed by GitHub
commit 5709d2e757
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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]