mirror of
https://github.com/penpot/penpot.git
synced 2025-07-28 14:47:12 +02:00
🐛 Fix problem when importing a SVG with text
This commit is contained in:
parent
89e2f4a481
commit
a4d362d43d
5 changed files with 69 additions and 32 deletions
|
@ -98,14 +98,8 @@
|
|||
(contains? shape :fill-color)
|
||||
{:fill (:fill-color shape)}
|
||||
|
||||
;; If contains svg-attrs the origin is svg. If it's not svg origin
|
||||
;; we setup the default fill as transparent (instead of black)
|
||||
(and (not (contains? shape :svg-attrs))
|
||||
(not (#{:svg-raw :group} (:type shape))))
|
||||
{:fill "none"}
|
||||
|
||||
:else
|
||||
{})
|
||||
{:fill "none"})
|
||||
|
||||
fill-attrs (cond-> fill-attrs
|
||||
(contains? shape :fill-opacity)
|
||||
|
@ -212,6 +206,13 @@
|
|||
(obj/set! "fill" (obj/get svg-styles "fill"))
|
||||
(obj/set! "fillOpacity" (obj/get svg-styles "fillOpacity")))
|
||||
|
||||
;; If contains svg-attrs the origin is svg. If it's not svg origin
|
||||
;; we setup the default fill as transparent (instead of black)
|
||||
(and (contains? shape :svg-attrs)
|
||||
(#{:svg-raw :group} (:type shape))
|
||||
(empty? (:fills shape)))
|
||||
styles
|
||||
|
||||
:else
|
||||
(add-fill styles (d/without-nils (get-in shape [:fills 0])) render-id 0))]
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue