mirror of
https://github.com/penpot/penpot.git
synced 2025-05-30 03:36:11 +02:00
🐛 Fix problem with imported svgs with filters
This commit is contained in:
parent
9ac4239c11
commit
6090cf6c68
3 changed files with 21 additions and 17 deletions
|
@ -179,25 +179,28 @@
|
|||
[attrs styles]))
|
||||
|
||||
(defn add-style-attrs
|
||||
[props shape]
|
||||
(let [render-id (mf/use-ctx muc/render-ctx)
|
||||
svg-defs (:svg-defs shape {})
|
||||
svg-attrs (:svg-attrs shape {})
|
||||
([props shape]
|
||||
(let [render-id (mf/use-ctx muc/render-ctx)]
|
||||
(add-style-attrs props shape render-id)))
|
||||
|
||||
[svg-attrs svg-styles] (mf/use-memo
|
||||
(mf/deps render-id svg-defs svg-attrs)
|
||||
#(extract-svg-attrs render-id svg-defs svg-attrs))
|
||||
([props shape render-id]
|
||||
(let [svg-defs (:svg-defs shape {})
|
||||
svg-attrs (:svg-attrs shape {})
|
||||
|
||||
styles (-> (obj/get props "style" (obj/new))
|
||||
(obj/merge! svg-styles)
|
||||
(add-fill shape render-id)
|
||||
(add-stroke shape render-id)
|
||||
(add-layer-props shape))]
|
||||
[svg-attrs svg-styles] (mf/use-memo
|
||||
(mf/deps render-id svg-defs svg-attrs)
|
||||
#(extract-svg-attrs render-id svg-defs svg-attrs))
|
||||
|
||||
(-> props
|
||||
(obj/merge! svg-attrs)
|
||||
(add-border-radius shape)
|
||||
(obj/set! "style" styles))))
|
||||
styles (-> (obj/get props "style" (obj/new))
|
||||
(obj/merge! svg-styles)
|
||||
(add-fill shape render-id)
|
||||
(add-stroke shape render-id)
|
||||
(add-layer-props shape))]
|
||||
|
||||
(-> props
|
||||
(obj/merge! svg-attrs)
|
||||
(add-border-radius shape)
|
||||
(obj/set! "style" styles)))))
|
||||
|
||||
(defn extract-style-attrs
|
||||
[shape]
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
(obj/set! "clipPath" (frame/frame-clip-url shape render-id))
|
||||
|
||||
(= :group type)
|
||||
(attrs/add-style-attrs shape))]
|
||||
(attrs/add-style-attrs shape render-id))]
|
||||
|
||||
[:& (mf/provider muc/render-ctx) {:value render-id}
|
||||
[:> :g wrapper-props
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue