mirror of
https://github.com/penpot/penpot.git
synced 2025-08-07 14:38:33 +02:00
✨ Don't stop SVG import when an image cannot be imported
This commit is contained in:
parent
6008dc12d3
commit
f2d1a4190a
4 changed files with 88 additions and 47 deletions
|
@ -328,7 +328,13 @@
|
|||
|
||||
props (cond-> props
|
||||
(d/not-empty? (:shadow shape))
|
||||
(obj/set! "filter" (dm/fmt "url(#filter_%)" render-id)))]
|
||||
(obj/set! "filter" (dm/fmt "url(#filter_%)" render-id)))
|
||||
|
||||
svg-defs (:svg-defs shape {})
|
||||
svg-attrs (:svg-attrs shape {})
|
||||
|
||||
[svg-attrs svg-styles]
|
||||
(attrs/extract-svg-attrs render-id svg-defs svg-attrs)]
|
||||
|
||||
(cond
|
||||
url-fill?
|
||||
|
@ -339,6 +345,25 @@
|
|||
(obj/without ["fill" "fillOpacity"])))]
|
||||
(obj/set! props "fill" (dm/fmt "url(#fill-0-%)" render-id)))
|
||||
|
||||
(obj/contains? svg-styles "fill")
|
||||
(let [style
|
||||
(-> (obj/get props "style")
|
||||
(obj/clone)
|
||||
(obj/set! "fill" (obj/get svg-styles "fill"))
|
||||
(obj/set! "fillOpacity" (obj/get svg-styles "fillOpacity")))]
|
||||
(-> props
|
||||
(obj/set! "style" style)))
|
||||
|
||||
(obj/contains? svg-attrs "fill")
|
||||
(let [style
|
||||
(-> (obj/get props "style")
|
||||
(obj/clone)
|
||||
(obj/set! "fill" (obj/get svg-attrs "fill"))
|
||||
(obj/set! "fillOpacity" (obj/get svg-attrs "fillOpacity")))]
|
||||
(-> props
|
||||
(obj/set! "style" style)))
|
||||
|
||||
|
||||
(d/not-empty? (:fills shape))
|
||||
(let [fill-props
|
||||
(attrs/extract-fill-attrs (get-in shape [:fills 0]) render-id 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue