mirror of
https://github.com/penpot/penpot.git
synced 2025-01-26 08:29:42 -05:00
🐛 Fix base background not visible for imported svg
This commit is contained in:
parent
18109b2387
commit
31aed2aaa4
1 changed files with 5 additions and 1 deletions
|
@ -355,7 +355,7 @@
|
||||||
(assoc :svg-attrs (dissoc attrs :x :y :width :height :href :xlink:href))))))
|
(assoc :svg-attrs (dissoc attrs :x :y :width :height :href :xlink:href))))))
|
||||||
|
|
||||||
(defn parse-svg-element [frame-id svg-data element-data unames]
|
(defn parse-svg-element [frame-id svg-data element-data unames]
|
||||||
(let [{:keys [tag attrs]} element-data
|
(let [{:keys [tag attrs hidden]} element-data
|
||||||
attrs (usvg/format-styles attrs)
|
attrs (usvg/format-styles attrs)
|
||||||
element-data (cond-> element-data (map? element-data) (assoc :attrs attrs))
|
element-data (cond-> element-data (map? element-data) (assoc :attrs attrs))
|
||||||
name (dwc/generate-unique-name unames (or (:id attrs) (tag->name tag)))
|
name (dwc/generate-unique-name unames (or (:id attrs) (tag->name tag)))
|
||||||
|
@ -402,6 +402,9 @@
|
||||||
(setup-fill)
|
(setup-fill)
|
||||||
(setup-stroke))
|
(setup-stroke))
|
||||||
|
|
||||||
|
shape (cond-> shape
|
||||||
|
hidden (assoc :hidden true))
|
||||||
|
|
||||||
children (cond->> (:content element-data)
|
children (cond->> (:content element-data)
|
||||||
(or (= tag :g) (= tag :svg))
|
(or (= tag :g) (= tag :svg))
|
||||||
(mapv #(usvg/inherit-attributes attrs %)))]
|
(mapv #(usvg/inherit-attributes attrs %)))]
|
||||||
|
@ -471,6 +474,7 @@
|
||||||
:height (str (:height root-shape))
|
:height (str (:height root-shape))
|
||||||
:fill "none"
|
:fill "none"
|
||||||
:id "base-background"}
|
:id "base-background"}
|
||||||
|
:hidden true
|
||||||
:content []}
|
:content []}
|
||||||
|
|
||||||
svg-data (-> svg-data
|
svg-data (-> svg-data
|
||||||
|
|
Loading…
Add table
Reference in a new issue