🐛 Fix user select layer mode

This commit is contained in:
Alejandro Alonso 2023-06-19 10:52:20 +02:00 committed by Andrey Antukh
parent d9375c1dd1
commit 23e200dece
2 changed files with 19 additions and 20 deletions

View file

@ -43,7 +43,6 @@
(mf/use-fn (mf/use-fn
(mf/deps on-change) (mf/deps on-change)
(fn [event] (fn [event]
(js/console.log event)
(let [value (-> (dom/get-current-target event) (let [value (-> (dom/get-current-target event)
(dom/get-data "value") (dom/get-data "value")
(d/read-string))] (d/read-string))]

View file

@ -40,7 +40,7 @@
type (unchecked-get props "type") type (unchecked-get props "type")
values (unchecked-get props "values") values (unchecked-get props "values")
current-blend-mode (d/name (or (:blend-mode values) :normal)) current-blend-mode (or (:blend-mode values) :normal)
current-opacity (:opacity values) current-opacity (:opacity values)
state* (mf/use-state state* (mf/use-state
@ -119,24 +119,24 @@
options options
(mf/with-memo [current-blend-mode] (mf/with-memo [current-blend-mode]
(d/concat-vec (d/concat-vec
(when (= "multiple" current-blend-mode) (when (= :multiple current-blend-mode)
[{:value "multiple" :label "--"}]) [{:value :multiple :label "--"}])
[{:value "normal" :label (tr "workspace.options.layer-options.blend-mode.normal")} [{:value :normal :label (tr "workspace.options.layer-options.blend-mode.normal")}
{:value "darken" :label (tr "workspace.options.layer-options.blend-mode.darken")} {:value :darken :label (tr "workspace.options.layer-options.blend-mode.darken")}
{:value "multiply" :label (tr "workspace.options.layer-options.blend-mode.multiply")} {:value :multiply :label (tr "workspace.options.layer-options.blend-mode.multiply")}
{:value "color-burn" :label (tr "workspace.options.layer-options.blend-mode.color-burn")} {:value :color-burn :label (tr "workspace.options.layer-options.blend-mode.color-burn")}
{:value "lighten" :label (tr "workspace.options.layer-options.blend-mode.lighten")} {:value :lighten :label (tr "workspace.options.layer-options.blend-mode.lighten")}
{:value "screen" :label (tr "workspace.options.layer-options.blend-mode.screen")} {:value :screen :label (tr "workspace.options.layer-options.blend-mode.screen")}
{:value "color-dodge" :label (tr "workspace.options.layer-options.blend-mode.color-dodge")} {:value :color-dodge :label (tr "workspace.options.layer-options.blend-mode.color-dodge")}
{:value "overlay" :label (tr "workspace.options.layer-options.blend-mode.overlay")} {:value :overlay :label (tr "workspace.options.layer-options.blend-mode.overlay")}
{:value "soft-light" :label (tr "workspace.options.layer-options.blend-mode.soft-light")} {:value :soft-light :label (tr "workspace.options.layer-options.blend-mode.soft-light")}
{:value "hard-light" :label (tr "workspace.options.layer-options.blend-mode.hard-light")} {:value :hard-light :label (tr "workspace.options.layer-options.blend-mode.hard-light")}
{:value "difference" :label (tr "workspace.options.layer-options.blend-mode.difference")} {:value :difference :label (tr "workspace.options.layer-options.blend-mode.difference")}
{:value "exclusion" :label (tr "workspace.options.layer-options.blend-mode.exclusion")} {:value :exclusion :label (tr "workspace.options.layer-options.blend-mode.exclusion")}
{:value "hue" :label (tr "workspace.options.layer-options.blend-mode.hue")} {:value :hue :label (tr "workspace.options.layer-options.blend-mode.hue")}
{:value "saturation" :label (tr "workspace.options.layer-options.blend-mode.saturation")} {:value :saturation :label (tr "workspace.options.layer-options.blend-mode.saturation")}
{:value "color" :label (tr "workspace.options.layer-options.blend-mode.color")} {:value :color :label (tr "workspace.options.layer-options.blend-mode.color")}
{:value "luminosity" :label (tr "workspace.options.layer-options.blend-mode.luminosity")}]))] {:value :luminosity :label (tr "workspace.options.layer-options.blend-mode.luminosity")}]))]
(mf/with-effect [current-blend-mode (mf/with-effect [current-blend-mode
option-highlighted? option-highlighted?