case back
This commit is contained in:
parent
504429c752
commit
4d14870150
1 changed files with 50 additions and 49 deletions
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue