mirror of
https://github.com/penpot/penpot.git
synced 2025-05-23 11:36:11 +02:00
🐛 Fix problem when changing color libraries
This commit is contained in:
parent
54e7551d56
commit
58dd23f9c7
3 changed files with 24 additions and 4 deletions
|
@ -5,6 +5,7 @@
|
||||||
### :bug: Bugs fixed
|
### :bug: Bugs fixed
|
||||||
|
|
||||||
- Fix error when importing files with touched components [Taiga #9625](https://tree.taiga.io/project/penpot/issue/9625)
|
- Fix error when importing files with touched components [Taiga #9625](https://tree.taiga.io/project/penpot/issue/9625)
|
||||||
|
- Fix problem when changing color libraries [Plugins #184](https://github.com/penpot/penpot-plugins/issues/184)
|
||||||
|
|
||||||
## 2.4.0
|
## 2.4.0
|
||||||
|
|
||||||
|
|
|
@ -191,6 +191,25 @@
|
||||||
(watch [it state _]
|
(watch [it state _]
|
||||||
(update-color* it state color file-id)))))
|
(update-color* it state color file-id)))))
|
||||||
|
|
||||||
|
(defn update-color-data
|
||||||
|
"Update color data without affecting the path location"
|
||||||
|
[color file-id]
|
||||||
|
(let [color (d/without-nils color)]
|
||||||
|
|
||||||
|
(dm/assert!
|
||||||
|
"expected valid color data structure"
|
||||||
|
(ctc/check-color! color))
|
||||||
|
|
||||||
|
(dm/assert!
|
||||||
|
"expected file-id"
|
||||||
|
(uuid? file-id))
|
||||||
|
|
||||||
|
(ptk/reify ::update-color-data
|
||||||
|
ptk/WatchEvent
|
||||||
|
(watch [it state _]
|
||||||
|
(let [color (assoc color :name (dm/str (:path color) "/" (:name color)))]
|
||||||
|
(update-color* it state color file-id))))))
|
||||||
|
|
||||||
(defn rename-color
|
(defn rename-color
|
||||||
[file-id id new-name]
|
[file-id id new-name]
|
||||||
(dm/assert!
|
(dm/assert!
|
||||||
|
|
|
@ -98,7 +98,7 @@
|
||||||
:else
|
:else
|
||||||
(let [color (-> (u/proxy->library-color self)
|
(let [color (-> (u/proxy->library-color self)
|
||||||
(assoc :color value))]
|
(assoc :color value))]
|
||||||
(st/emit! (dwl/update-color color file-id)))))}
|
(st/emit! (dwl/update-color-data color file-id)))))}
|
||||||
|
|
||||||
:opacity
|
:opacity
|
||||||
{:this true
|
{:this true
|
||||||
|
@ -115,7 +115,7 @@
|
||||||
:else
|
:else
|
||||||
(let [color (-> (u/proxy->library-color self)
|
(let [color (-> (u/proxy->library-color self)
|
||||||
(assoc :opacity value))]
|
(assoc :opacity value))]
|
||||||
(st/emit! (dwl/update-color color file-id)))))}
|
(st/emit! (dwl/update-color-data color file-id)))))}
|
||||||
|
|
||||||
:gradient
|
:gradient
|
||||||
{:this true
|
{:this true
|
||||||
|
@ -133,7 +133,7 @@
|
||||||
:else
|
:else
|
||||||
(let [color (-> (u/proxy->library-color self)
|
(let [color (-> (u/proxy->library-color self)
|
||||||
(assoc :gradient value))]
|
(assoc :gradient value))]
|
||||||
(st/emit! (dwl/update-color color file-id))))))}
|
(st/emit! (dwl/update-color-data color file-id))))))}
|
||||||
|
|
||||||
:image
|
:image
|
||||||
{:this true
|
{:this true
|
||||||
|
@ -151,7 +151,7 @@
|
||||||
:else
|
:else
|
||||||
(let [color (-> (u/proxy->library-color self)
|
(let [color (-> (u/proxy->library-color self)
|
||||||
(assoc :image value))]
|
(assoc :image value))]
|
||||||
(st/emit! (dwl/update-color color file-id))))))}
|
(st/emit! (dwl/update-color-data color file-id))))))}
|
||||||
|
|
||||||
:remove
|
:remove
|
||||||
(fn []
|
(fn []
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue