0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-10 08:50:57 -05:00

🐛 Remove gradient if any when applyin solid color from library

This commit is contained in:
Eva 2022-01-10 09:31:10 +01:00 committed by Andrés Moya
parent 16c4116c15
commit 1ded4b2b28
3 changed files with 13 additions and 4 deletions

View file

@ -17,6 +17,7 @@
### :bug: Bugs fixed
- Fix remove gradient if any when applying color from library [Taiga #2299](https://tree.taiga.io/project/penpot/issue/2299).
- Fix Enter as key action to exit edit path [Taiga #2444](https://tree.taiga.io/project/penpot/issue/2444).
- Fix add fill color from palette to groups and components [Taiga #2313](https://tree.taiga.io/project/penpot/issue/2313).
- Fix default project name in all languages [Taiga #2280](https://tree.taiga.io/project/penpot/issue/2280).

View file

@ -123,7 +123,11 @@
text-ids (filter is-text? ids)
shape-ids (filter (comp not is-text?) ids)
attrs (cond-> {}
attrs (cond-> {:fill-color nil
:fill-color-gradient nil
::fill-color-ref-file nil
:fill-color-ref-id nil
:fill-opacity nil}
(contains? color :color)
(assoc :fill-color (:color color))
@ -138,7 +142,7 @@
(contains? color :opacity)
(assoc :fill-opacity (:opacity color)))]
(rx/concat
(rx/from (map #(dwt/update-text-attrs {:id % :attrs attrs}) text-ids))
(rx/of (dch/update-shapes shape-ids (fn [shape] (d/merge shape attrs)))))))))
@ -148,7 +152,11 @@
(ptk/reify ::change-stroke
ptk/WatchEvent
(watch [_ _ _]
(let [attrs (cond-> {}
(let [attrs (cond-> {:stroke-color nil
:stroke-color-ref-id nil
:stroke-color-ref-file nil
:stroke-color-gradient nil
:stroke-opacity nil}
(contains? color :color)
(assoc :stroke-color (:color color))

View file

@ -797,7 +797,7 @@
apply-color
(fn [_ event]
(let [ids (wsh/lookup-selected @st/state)]
(if (kbd/shift? event)
(if (kbd/alt? event)
(st/emit! (dc/change-stroke ids color))
(st/emit! (dc/change-fill ids color)))))