mirror of
https://github.com/penpot/penpot.git
synced 2025-03-12 07:41:43 -05:00
🐛 Fix add asset color, invalid color appears
This commit is contained in:
parent
c988d54925
commit
a8e058ada6
2 changed files with 8 additions and 4 deletions
|
@ -21,7 +21,6 @@
|
||||||
[app.main.data.workspace.state-helpers :as wsh]
|
[app.main.data.workspace.state-helpers :as wsh]
|
||||||
[app.main.data.workspace.texts :as dwt]
|
[app.main.data.workspace.texts :as dwt]
|
||||||
[app.main.data.workspace.undo :as dwu]
|
[app.main.data.workspace.undo :as dwu]
|
||||||
[app.main.store :as st]
|
|
||||||
[app.util.color :as uc]
|
[app.util.color :as uc]
|
||||||
[beicon.core :as rx]
|
[beicon.core :as rx]
|
||||||
[potok.core :as ptk]))
|
[potok.core :as ptk]))
|
||||||
|
@ -610,7 +609,7 @@
|
||||||
(materialize-color-components))]))))))))))
|
(materialize-color-components))]))))))))))
|
||||||
|
|
||||||
(defn select-color
|
(defn select-color
|
||||||
[position]
|
[position add-color]
|
||||||
(ptk/reify ::select-color
|
(ptk/reify ::select-color
|
||||||
ptk/WatchEvent
|
ptk/WatchEvent
|
||||||
(watch [_ state _]
|
(watch [_ state _]
|
||||||
|
@ -635,7 +634,7 @@
|
||||||
(rx/of (md/show :colorpicker
|
(rx/of (md/show :colorpicker
|
||||||
{:x (:x position)
|
{:x (:x position)
|
||||||
:y (:y position)
|
:y (:y position)
|
||||||
:on-accept #(st/emit! (dwl/add-color data))
|
:on-accept add-color
|
||||||
:data data
|
:data data
|
||||||
:position :right})
|
:position :right})
|
||||||
(ptk/event ::ev/event {::ev/name "add-asset-to-library"
|
(ptk/event ::ev/event {::ev/name "add-asset-to-library"
|
||||||
|
|
|
@ -1546,11 +1546,16 @@
|
||||||
|
|
||||||
read-only? (mf/use-ctx ctx/workspace-read-only?)
|
read-only? (mf/use-ctx ctx/workspace-read-only?)
|
||||||
|
|
||||||
|
add-color
|
||||||
|
(mf/use-fn
|
||||||
|
(fn [value _]
|
||||||
|
(st/emit! (dwl/add-color value))))
|
||||||
|
|
||||||
add-color-clicked
|
add-color-clicked
|
||||||
(mf/use-fn
|
(mf/use-fn
|
||||||
(fn [event]
|
(fn [event]
|
||||||
(let [position (dom/get-client-position event)]
|
(let [position (dom/get-client-position event)]
|
||||||
(st/emit! (dc/select-color position)))))
|
(st/emit! (dc/select-color position add-color)))))
|
||||||
|
|
||||||
create-group
|
create-group
|
||||||
(mf/use-fn
|
(mf/use-fn
|
||||||
|
|
Loading…
Add table
Reference in a new issue