mirror of
https://github.com/penpot/penpot.git
synced 2025-05-29 01:46:12 +02:00
Merge pull request #2300 from penpot/superalex-fix-change-multiple-colors-with-svg
🐛 Fix change multiple colors with svg
This commit is contained in:
commit
ee8b5cc1c5
2 changed files with 14 additions and 3 deletions
|
@ -166,7 +166,17 @@
|
|||
(dissoc :name)
|
||||
(dissoc :path)
|
||||
(d/without-nils))
|
||||
shapes-by-color (get @grouped-colors* old-color)]
|
||||
|
||||
prev-color (-> @prev-color*
|
||||
(dissoc :name)
|
||||
(dissoc :path)
|
||||
(d/without-nils))
|
||||
|
||||
;; When dragging on the color picker sometimes all the shapes hasn't updated the color to the prev value so we need this extra calculation
|
||||
shapes-by-old-color (get @grouped-colors* old-color)
|
||||
shapes-by-prev-color (get @grouped-colors* prev-color)
|
||||
shapes-by-color (or shapes-by-prev-color shapes-by-old-color)]
|
||||
(reset! prev-color* new-color)
|
||||
(st/emit! (dc/change-color-in-selected new-color shapes-by-color old-color)))))
|
||||
|
||||
on-open (mf/use-fn
|
||||
|
@ -197,7 +207,7 @@
|
|||
[:div.element-set-content
|
||||
[:div.selected-colors
|
||||
(for [[index color] (d/enumerate (take 3 library-colors))]
|
||||
[:& color-row {:key (dm/str "color-" index)
|
||||
[:& color-row {:key (dm/str "library-color-" index)
|
||||
:color color
|
||||
:index index
|
||||
:on-detach on-detach
|
||||
|
@ -210,7 +220,7 @@
|
|||
[:span.text (tr "workspace.options.more-lib-colors")]])
|
||||
(when @expand-lib-color
|
||||
(for [[index color] (d/enumerate (drop 3 library-colors))]
|
||||
[:& color-row {:key (dm/str "color-" index)
|
||||
[:& color-row {:key (dm/str "library-color-" index)
|
||||
:color color
|
||||
:index index
|
||||
:on-detach on-detach
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue