mirror of
https://github.com/penpot/penpot.git
synced 2025-01-23 23:18:48 -05:00
🐛 Fixed problem with styles inside def for svg import
This commit is contained in:
parent
16854e7e83
commit
e40245e187
1 changed files with 4 additions and 2 deletions
|
@ -206,7 +206,6 @@
|
||||||
:height height
|
:height height
|
||||||
:x x
|
:x x
|
||||||
:y y
|
:y y
|
||||||
:hidden (= tag :defs)
|
|
||||||
:content (cond-> data
|
:content (cond-> data
|
||||||
(map? data) (update :attrs usvg/clean-attrs))}
|
(map? data) (update :attrs usvg/clean-attrs))}
|
||||||
(assoc :svg-attrs attrs)
|
(assoc :svg-attrs attrs)
|
||||||
|
@ -437,6 +436,7 @@
|
||||||
children (cond->> (:content element-data)
|
children (cond->> (:content element-data)
|
||||||
(contains? usvg/parent-tags tag)
|
(contains? usvg/parent-tags tag)
|
||||||
(mapv #(usvg/inherit-attributes attrs %)))]
|
(mapv #(usvg/inherit-attributes attrs %)))]
|
||||||
|
|
||||||
[shape children]))))))
|
[shape children]))))))
|
||||||
|
|
||||||
(defn create-svg-children
|
(defn create-svg-children
|
||||||
|
@ -537,7 +537,8 @@
|
||||||
root-shape (create-svg-root frame-id parent-id svg-data)
|
root-shape (create-svg-root frame-id parent-id svg-data)
|
||||||
root-id (:id root-shape)
|
root-id (:id root-shape)
|
||||||
|
|
||||||
;; In penpot groups have the size of their children. To respect the imported svg size and empty space let's create a transparent shape as background to respect the imported size
|
;; In penpot groups have the size of their children. To respect the imported
|
||||||
|
;; svg size and empty space let's create a transparent shape as background to respect the imported size
|
||||||
base-background-shape {:tag :rect
|
base-background-shape {:tag :rect
|
||||||
:attrs {:x (str vb-x)
|
:attrs {:x (str vb-x)
|
||||||
:y (str vb-y)
|
:y (str vb-y)
|
||||||
|
@ -588,6 +589,7 @@
|
||||||
|
|
||||||
[new-shape new-children]
|
[new-shape new-children]
|
||||||
(create-svg-shapes svg-data position objects frame-id parent-id selected true)
|
(create-svg-shapes svg-data position objects frame-id parent-id selected true)
|
||||||
|
|
||||||
changes (-> (pcb/empty-changes it page-id)
|
changes (-> (pcb/empty-changes it page-id)
|
||||||
(pcb/with-objects objects)
|
(pcb/with-objects objects)
|
||||||
(pcb/add-object new-shape))
|
(pcb/add-object new-shape))
|
||||||
|
|
Loading…
Add table
Reference in a new issue