mirror of
https://github.com/penpot/penpot.git
synced 2025-06-10 08:41:40 +02:00
🐛 Fix color token only applying fill
This commit is contained in:
parent
4a06cc04d8
commit
b9ada1f520
3 changed files with 12 additions and 4 deletions
|
@ -143,6 +143,14 @@
|
||||||
[value shape-ids]
|
[value shape-ids]
|
||||||
(update-color wdc/change-stroke value shape-ids))
|
(update-color wdc/change-stroke value shape-ids))
|
||||||
|
|
||||||
|
(defn update-fill-stroke [value shape-ids attributes]
|
||||||
|
(ptk/reify ::update-fill-stroke
|
||||||
|
ptk/WatchEvent
|
||||||
|
(watch [_ _ _]
|
||||||
|
(rx/of
|
||||||
|
(when (:fill attributes) (update-fill value shape-ids))
|
||||||
|
(when (:stroke-color attributes) (update-stroke-color value shape-ids))))))
|
||||||
|
|
||||||
(defn update-shape-dimensions [value shape-ids attributes]
|
(defn update-shape-dimensions [value shape-ids attributes]
|
||||||
(ptk/reify ::update-shape-dimensions
|
(ptk/reify ::update-shape-dimensions
|
||||||
ptk/WatchEvent
|
ptk/WatchEvent
|
||||||
|
|
|
@ -23,8 +23,9 @@
|
||||||
|
|
||||||
:color
|
:color
|
||||||
{:title "Color"
|
{:title "Color"
|
||||||
:attributes ctt/color-keys
|
:attributes #{:fill}
|
||||||
:on-update-shape wtch/update-fill
|
:all-attributes ctt/color-keys
|
||||||
|
:on-update-shape wtch/update-fill-stroke
|
||||||
:modal {:key :tokens/color
|
:modal {:key :tokens/color
|
||||||
:fields [{:label "Color" :key :color}]}}
|
:fields [{:label "Color" :key :color}]}}
|
||||||
|
|
||||||
|
|
|
@ -19,8 +19,7 @@
|
||||||
(def attributes->shape-update
|
(def attributes->shape-update
|
||||||
{#{:rx :ry} (fn [v ids _] (wtch/update-shape-radius-all v ids))
|
{#{:rx :ry} (fn [v ids _] (wtch/update-shape-radius-all v ids))
|
||||||
#{:r1 :r2 :r3 :r4} wtch/update-shape-radius-single-corner
|
#{:r1 :r2 :r3 :r4} wtch/update-shape-radius-single-corner
|
||||||
#{:fill} wtch/update-fill
|
ctt/color-keys wtch/update-fill-stroke
|
||||||
#{:stroke-color} wtch/update-stroke-color
|
|
||||||
ctt/stroke-width-keys wtch/update-stroke-width
|
ctt/stroke-width-keys wtch/update-stroke-width
|
||||||
ctt/sizing-keys wtch/update-shape-dimensions
|
ctt/sizing-keys wtch/update-shape-dimensions
|
||||||
ctt/opacity-keys wtch/update-opacity
|
ctt/opacity-keys wtch/update-opacity
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue