0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-26 08:29:42 -05:00

🐛 Fix opacity display when selecting multiple shapes

This commit is contained in:
Belén Albeza 2024-02-12 16:11:50 +01:00 committed by Alonso Torres
parent 9fbdc10971
commit d63e5f520e

View file

@ -23,11 +23,11 @@
(defn opacity->string (defn opacity->string
[opacity] [opacity]
(if (= opacity :multiple) (if (not= opacity :multiple)
""
(dm/str (-> opacity (dm/str (-> opacity
(d/coalesce 1) (d/coalesce 1)
(* 100))))) (* 100)))
:multiple))
(mf/defc layer-menu (mf/defc layer-menu
{::mf/wrap-props false} {::mf/wrap-props false}
@ -39,7 +39,7 @@
blocked? (:blocked values) blocked? (:blocked values)
current-blend-mode (or (:blend-mode values) :normal) current-blend-mode (or (:blend-mode values) :normal)
current-opacity (:opacity values) current-opacity (opacity->string (:opacity values))
state* (mf/use-state state* (mf/use-state
{:selected-blend-mode current-blend-mode {:selected-blend-mode current-blend-mode
@ -161,8 +161,8 @@
:title (tr "workspace.options.opacity")} :title (tr "workspace.options.opacity")}
[:span {:class (stl/css :icon)} "%"] [:span {:class (stl/css :icon)} "%"]
[:> numeric-input* [:> numeric-input*
{:value (opacity->string current-opacity) {:value current-opacity
:placeholder (tr "settings.multiple") :placeholder "--"
:on-change handle-opacity-change :on-change handle-opacity-change
:min 0 :min 0
:max 100 :max 100