fix experiment

This commit is contained in:
Ryan Oldenburg 2021-06-27 16:41:26 -05:00
parent 32c3072e0a
commit f1c43b2e31

View file

@ -1,11 +1,13 @@
## Load and Save SVG files. ## Load and Save SVG files.
import cairo, chroma, pixie/common, pixie/images, pixie/paths, strutils, vmath, import cairo, chroma, pixie/common, pixie/images, strutils, vmath,
xmlparser, xmltree xmlparser, xmltree
type Path = paths.Path include pixie/paths
proc processCommands(c: ptr Context, path: paths.Path) = # type Path = paths.Path
proc processCommands(c: ptr Context, path: Path) =
c.newPath() c.newPath()
c.moveTo(0, 0) c.moveTo(0, 0)
for i, command in path.commands: for i, command in path.commands:
@ -99,8 +101,8 @@ type Ctx = object
fillRule: WindingRule fillRule: WindingRule
fill, stroke: ColorRGBA fill, stroke: ColorRGBA
strokeWidth: float32 strokeWidth: float32
strokeLineCap: paths.LineCap strokeLineCap: LineCap
strokeLineJoin: paths.LineJoin strokeLineJoin: LineJoin
strokeMiterLimit: float32 strokeMiterLimit: float32
strokeDashArray: seq[float32] strokeDashArray: seq[float32]
transform: Mat3 transform: Mat3
@ -319,7 +321,7 @@ proc decodeCtx(inherited: Ctx, node: XmlNode): Ctx =
else: else:
failInvalidTransform(transform) failInvalidTransform(transform)
proc cairoLineCap(lineCap: paths.LineCap): cairo.LineCap = proc cairoLineCap(lineCap: LineCap): cairo.LineCap =
case lineCap: case lineCap:
of lcButt: of lcButt:
LineCapButt LineCapButt
@ -328,7 +330,7 @@ proc cairoLineCap(lineCap: paths.LineCap): cairo.LineCap =
of lcSquare: of lcSquare:
LineCapSquare LineCapSquare
proc cairoLineJoin(lineJoin: paths.LineJoin): cairo.LineJoin = proc cairoLineJoin(lineJoin: LineJoin): cairo.LineJoin =
case lineJoin: case lineJoin:
of ljMiter: of ljMiter:
LineJoinMiter LineJoinMiter