🐛 Fix error streen when uploading wrong SVG

This commit is contained in:
alonso.torres 2023-03-02 16:24:23 +01:00
parent 7b72906096
commit 6962e15b6d
4 changed files with 103 additions and 93 deletions

View file

@ -820,6 +820,10 @@
(defn line->path [{:keys [attrs] :as node}]
(let [tag :path
{:keys [x1 y1 x2 y2]} attrs
x1 (or x1 0)
y1 (or y1 0)
x2 (or x2 0)
y2 (or y2 0)
attrs (-> attrs
(dissoc :x1 :x2 :y1 :y2)
(assoc :d (str "M" x1 "," y1 " L" x2 "," y2)))]