0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-15 19:48:22 -05:00

🐛 Fixes problem when exporting svg's

This commit is contained in:
alonso.torres 2021-04-09 14:05:32 +02:00
parent 4e1d85a5f4
commit 080dd88509

View file

@ -65,7 +65,7 @@
(defn ^boolean empty-path-element? (defn ^boolean empty-path-element?
[item] [item]
(and (= (get item "name") "path") (and (= (get item "name") "path")
(let [d (get item ["attributes" "d"])] (let [d (get-in item ["attributes" "d"])]
(or (str/blank? d) (or (str/blank? d)
(nil? d) (nil? d)
(str/empty? d))))) (str/empty? d)))))
@ -93,16 +93,7 @@
item)) item))
(process-element [item xform] (process-element [item xform]
(let [item (d/update-when item "elements" #(into [] xform %))] (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)))]
(let [xform (comp (remove empty-defs-element?) (let [xform (comp (remove empty-defs-element?)
(remove empty-path-element?) (remove empty-path-element?)