🐛 Fix incorrect opacity assignation on changing fill from solid to gradient

This commit is contained in:
Andrey Antukh 2025-06-05 13:25:09 +02:00
parent 6719902647
commit 9c4b60e95f

View File

@ -720,7 +720,8 @@
[{:keys [hex alpha] :as data}]
(-> data
(assoc :color hex)
(assoc :opacity alpha)))
(assoc :opacity alpha)
(d/without-nils)))
(defn clear-color-components
[data]
@ -748,13 +749,14 @@
(clear-image-components current-color)
:else
{:opacity opacity
:gradient (-> gradient
(assoc :type (case type
:linear-gradient :linear
:radial-gradient :radial))
(assoc :stops (mapv clear-color-components stops))
(dissoc :shape-id))}))
(d/without-nils
{:opacity opacity
:gradient (-> gradient
(assoc :type (case type
:linear-gradient :linear
:radial-gradient :radial))
(assoc :stops (mapv clear-color-components stops))
(dissoc :shape-id))})))
(defn- colorpicker-onchange-runner
"Effect event that runs the on-change callback with the latest