Open Townk opened 3 years ago
I think the problem is related to the absence of a viewbox in the svg file. I need to create a default view box when this is the case:
;; Read original viewbox
(viewbox (cdr (assq 'viewBox (xml-node-attributes (car root)))))
(viewbox (mapcar 'string-to-number (split-string viewbox)))
(view-x (nth 0 viewbox))
(view-y (nth 1 viewbox))
(view-width (nth 2 viewbox))
(view-height (nth 3 viewbox))
If viewbox is nil, we should get the width and height of the SVG and set view-width and view-height with them while view-x and view-y should be 0. Could you try and make a PR?
I tried to add the file-type collection by installing
svg-icon
using the following:If I try to access a file on the
file
collection directly on the browser, all works like expected:But if I try to use
svg-icon
to insert the same icon with:I get the following error:
I'm using Emacs 27.1 with Doom-emacs, on a Mac with macOS Catalina.