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")
|
raise newException(PixieError, "Invalid SVG data")
|
||||||
|
|
||||||
proc draw(img: Image, matStack: var seq[Mat3], xml: XmlNode) =
|
proc draw(img: Image, matStack: var seq[Mat3], xml: XmlNode) =
|
||||||
if xml.tag != "g":
|
case xml.tag:
|
||||||
raise newException(PixieError, "Unsupported SVG tag: " & xml.tag & ".")
|
of "g":
|
||||||
|
|
||||||
let
|
let
|
||||||
fill = xml.attr("fill")
|
fill = xml.attr("fill")
|
||||||
stroke = xml.attr("stroke")
|
stroke = xml.attr("stroke")
|
||||||
|
@ -59,6 +58,8 @@ proc draw(img: Image, matStack: var seq[Mat3], xml: XmlNode) =
|
||||||
|
|
||||||
if transform != "":
|
if transform != "":
|
||||||
discard matStack.pop()
|
discard matStack.pop()
|
||||||
|
else:
|
||||||
|
raise newException(PixieError, "Unsupported SVG tag: " & xml.tag & ".")
|
||||||
|
|
||||||
proc decodeSvg*(data: string): Image =
|
proc decodeSvg*(data: string): Image =
|
||||||
## Render SVG file and return the image.
|
## Render SVG file and return the image.
|
||||||
|
|
Loading…
Reference in a new issue