case back

This commit is contained in:
Ryan Oldenburg 2020-12-14 13:11:14 -06:00
parent 504429c752
commit 4d14870150

View file

@ -9,9 +9,8 @@ template failInvalid() =
raise newException(PixieError, "Invalid SVG data")
proc draw(img: Image, matStack: var seq[Mat3], xml: XmlNode) =
if xml.tag != "g":
raise newException(PixieError, "Unsupported SVG tag: " & xml.tag & ".")
case xml.tag:
of "g":
let
fill = xml.attr("fill")
stroke = xml.attr("stroke")
@ -59,6 +58,8 @@ proc draw(img: Image, matStack: var seq[Mat3], xml: XmlNode) =
if transform != "":
discard matStack.pop()
else:
raise newException(PixieError, "Unsupported SVG tag: " & xml.tag & ".")
proc decodeSvg*(data: string): Image =
## Render SVG file and return the image.