🐛 Fixes problems with blending modes

This commit is contained in:
alonso.torres 2021-04-23 13:28:55 +02:00 committed by Andrés Moya
parent 1584f3771b
commit 1ee1cada9e
3 changed files with 7 additions and 5 deletions

View file

@ -121,10 +121,7 @@
(defn add-layer-props [attrs shape]
(cond-> attrs
(:opacity shape)
(obj/set! "opacity" (:opacity shape))
(and (:blend-mode shape) (not= (:blend-mode shape) :normal))
(obj/set! "mixBlendMode" (d/name (:blend-mode shape)))))
(obj/set! "opacity" (:opacity shape))))
(defn extract-svg-attrs
[render-id svg-defs svg-attrs]

View file

@ -6,6 +6,7 @@
(ns app.main.ui.shapes.shape
(:require
[app.common.data :as d]
[app.common.uuid :as uuid]
[app.main.ui.context :as muc]
[app.main.ui.shapes.filters :as filters]
@ -23,7 +24,10 @@
render-id (mf/use-memo #(str (uuid/next)))
filter-id (str "filter_" render-id)
styles (-> (obj/new)
(obj/set! "pointerEvents" pointer-events))
(obj/set! "pointerEvents" pointer-events)
(cond-> (and (:blend-mode shape) (not= (:blend-mode shape) :normal))
(obj/set! "mixBlendMode" (d/name (:blend-mode shape)))))
{:keys [x y width height type]} shape
frame? (= :frame type)