mirror of
https://github.com/penpot/penpot.git
synced 2025-05-29 18:06:10 +02:00
🐛 Fix what happens when user click on an fill image recent color
This commit is contained in:
parent
0528c26b5e
commit
aca5289b21
1 changed files with 8 additions and 2 deletions
|
@ -172,7 +172,12 @@
|
|||
(cond-> (= index 0) (assoc :stops [(clean-stop old-stops 0 color) (nth old-stops 1)]))
|
||||
(cond-> (= index 1) (assoc :stops [(nth old-stops 0) (clean-stop old-stops 1 color)]))
|
||||
(dissoc :shape-id))]
|
||||
(change-to {:gradient new-gradient})))]
|
||||
(change-to {:gradient new-gradient})))
|
||||
new-mode (cond
|
||||
(:image color) :image
|
||||
(:color color) :color
|
||||
(= :linear (get-in color [:gradient :type])) :linear-gradient
|
||||
(= :radial (get-in color [:gradient :type])) :radial-gradient)]
|
||||
;; If we have any kind of gradient and:
|
||||
;; Click on a solid color -> This color is applied to the selected offset
|
||||
;; Click on a color with transparency -> The same to solid color will happend
|
||||
|
@ -183,7 +188,8 @@
|
|||
(if is-gradient?
|
||||
(change-to color)
|
||||
(set-new-gradient state color editig-stop-origin))
|
||||
(change-to color)))))
|
||||
(change-to color))
|
||||
(handle-change-mode new-mode))))
|
||||
|
||||
on-add-library-color
|
||||
(mf/use-fn
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue