Improvements after review

This commit is contained in:
alonso.torres 2021-03-08 17:37:37 +01:00
parent 517751c116
commit cf78861396

View file

@ -11,6 +11,7 @@
(:require (:require
[rumext.alpha :as mf] [rumext.alpha :as mf]
[cuerdas.core :as str] [cuerdas.core :as str]
[app.common.data :as d]
[app.util.object :as obj] [app.util.object :as obj]
[app.main.ui.context :as muc] [app.main.ui.context :as muc]
[app.util.svg :as usvg])) [app.util.svg :as usvg]))
@ -121,15 +122,12 @@
attrs))) attrs)))
(defn add-layer-props [attrs shape] (defn add-layer-props [attrs shape]
(let [layer-attrs (cond-> attrs
(cond-> {} (:opacity shape)
(:opacity shape) (obj/set! "opacity" (:opacity shape))
(assoc :opacity (:opacity shape))
(and (:blend-mode shape) (not= (:blend-mode shape) :normal)) (and (:blend-mode shape) (not= (:blend-mode shape) :normal))
(assoc :mixBlendMode (:blend-mode shape)))] (obj/set! "mixBlendMode" (d/name (:blend-mode shape)))))
(obj/merge! attrs (clj->js layer-attrs))))
(defn extract-svg-attrs (defn extract-svg-attrs
[render-id svg-defs svg-attrs] [render-id svg-defs svg-attrs]