diff --git a/src/pixie/fileformats/svg.nim b/src/pixie/fileformats/svg.nim index 71bcf61..e3918a2 100644 --- a/src/pixie/fileformats/svg.nim +++ b/src/pixie/fileformats/svg.nim @@ -345,7 +345,7 @@ proc stroke(img: Image, ctx: Ctx, path: Path) {.inline.} = dashes = ctx.strokeDashArray ) -proc drawInternal(img: Image, node: XmlNode, ctxStack: var seq[Ctx]) = +proc draw(img: Image, node: XmlNode, ctxStack: var seq[Ctx]) = if node.kind != xnElement: # Skip return @@ -362,7 +362,7 @@ proc drawInternal(img: Image, node: XmlNode, ctxStack: var seq[Ctx]) = let ctx = decodeCtx(ctxStack[^1], node) ctxStack.add(ctx) for child in node: - img.drawInternal(child, ctxStack) + img.draw(child, ctxStack) discard ctxStack.pop() of "path": @@ -552,14 +552,6 @@ proc drawInternal(img: Image, node: XmlNode, ctxStack: var seq[Ctx]) = else: raise newException(PixieError, "Unsupported SVG tag: " & node.tag) -proc draw(img: Image, node: XmlNode, ctxStack: var seq[Ctx]) = - try: - drawInternal(img, node, ctxStack) - except PixieError as e: - raise e - except: - raise currentExceptionAsPixieError() - proc decodeSvg*( data: string | XmlNode, width = 0, height = 0 ): Image {.raises: [PixieError].} =