mirror of
https://github.com/penpot/penpot.git
synced 2025-02-12 10:09:03 -05:00
🐛 Fixes problem when exporting svg's
This commit is contained in:
parent
4e1d85a5f4
commit
080dd88509
1 changed files with 2 additions and 11 deletions
|
@ -65,7 +65,7 @@
|
|||
(defn ^boolean empty-path-element?
|
||||
[item]
|
||||
(and (= (get item "name") "path")
|
||||
(let [d (get item ["attributes" "d"])]
|
||||
(let [d (get-in item ["attributes" "d"])]
|
||||
(or (str/blank? d)
|
||||
(nil? d)
|
||||
(str/empty? d)))))
|
||||
|
@ -93,16 +93,7 @@
|
|||
item))
|
||||
|
||||
(process-element [item xform]
|
||||
(let [item (d/update-when item "elements" #(into [] xform %))]
|
||||
(if (shape-element? item)
|
||||
(update item "elements"
|
||||
(fn [elements]
|
||||
;; flatten content of a shape element
|
||||
(into [] (mapcat (fn [item]
|
||||
(if (group-element? item)
|
||||
(get item "elements")
|
||||
[item]))) elements)))
|
||||
item)))]
|
||||
(d/update-when item "elements" #(into [] xform %)))]
|
||||
|
||||
(let [xform (comp (remove empty-defs-element?)
|
||||
(remove empty-path-element?)
|
||||
|
|
Loading…
Add table
Reference in a new issue