Types
WindingRule = enum NonZero, EvenOdd
- Winding rules. Source Edit
Consts
defaultMiterLimit: float32 = 4.0
- Source Edit
Procs
proc angleToMiterLimit(angle: float32): float32 {.inline, ...raises: [], tags: [], forbids: [].}
- Converts miter-limit-angle to miter-limit-ratio. Source Edit
proc arc(path: Path; pos: Vec2; r: float32; a: Vec2; ccw: bool = false) {. inline, ...raises: [PixieError], tags: [], forbids: [].}
- Adds a circular arc to the current sub-path. Source Edit
proc arc(path: Path; x, y, r, a0, a1: float32; ccw: bool = false) {. ...raises: [PixieError], tags: [], forbids: [].}
- Adds a circular arc to the current sub-path. Source Edit
proc arcTo(path: Path; a, b: Vec2; r: float32) {.inline, ...raises: [PixieError], tags: [], forbids: [].}
- Adds a circular arc using the given control points and radius. Source Edit
proc arcTo(path: Path; x1, y1, x2, y2, r: float32) {....raises: [PixieError], tags: [], forbids: [].}
- Adds a circular arc using the given control points and radius. Commonly used for making rounded corners. Source Edit
proc bezierCurveTo(path: Path; ctrl1, ctrl2, to: Vec2) {.inline, ...raises: [], tags: [], forbids: [].}
- Adds a cubic Bézier curve to the current sub-path. It requires three points: the first two are control points and the third one is the end point. The starting point is the latest point in the current path, which can be changed using moveTo() before creating the Bézier curve. Source Edit
proc bezierCurveTo(path: Path; x1, y1, x2, y2, x3, y3: float32) {....raises: [], tags: [], forbids: [].}
- Adds a cubic Bézier curve to the current sub-path. It requires three points: the first two are control points and the third one is the end point. The starting point is the latest point in the current path, which can be changed using moveTo() before creating the Bézier curve. Source Edit
proc computeBounds(path: Path; transform = mat3()): Rect {....raises: [PixieError], tags: [], forbids: [].}
- Compute the bounds of the path. Source Edit
proc ellipticalArcTo(path: Path; rx, ry: float32; xAxisRotation: float32; largeArcFlag, sweepFlag: bool; x, y: float32) {....raises: [], tags: [], forbids: [].}
- Adds an elliptical arc to the current sub-path, using the given radius ratios, sweep flags, and end position. Source Edit
proc fillOverlaps(path: Path; test: Vec2; transform = mat3(); ## Applied to the path, not the test point. windingRule = NonZero): bool {....raises: [PixieError], tags: [], forbids: [].}
- Returns whether or not the specified point is contained in the current path. Source Edit
proc miterLimitToAngle(limit: float32): float32 {.inline, ...raises: [], tags: [], forbids: [].}
- Converts miter-limit-ratio to miter-limit-angle. Source Edit
proc parsePath(path: string): Path {....raises: [PixieError], tags: [], forbids: [].}
- Converts a SVG style path string into seq of commands. Source Edit
proc polygon(path: Path; pos: Vec2; size: float32; sides: int) {.inline, ...raises: [PixieError], tags: [], forbids: [].}
- Adds a n-sided regular polygon at (x, y) with the parameter size. Source Edit
proc polygon(path: Path; x, y, size: float32; sides: int) {. ...raises: [PixieError], tags: [], forbids: [].}
- Adds an n-sided regular polygon at (x, y) with the parameter size. Polygons "face" north. Source Edit
proc quadraticCurveTo(path: Path; ctrl, to: Vec2) {.inline, ...raises: [], tags: [], forbids: [].}
- Adds a quadratic Bézier curve to the current sub-path. It requires two points: the first one is a control point and the second one is the end point. The starting point is the latest point in the current path, which can be changed using moveTo() before creating the quadratic Bézier curve. Source Edit
proc quadraticCurveTo(path: Path; x1, y1, x2, y2: float32) {....raises: [], tags: [], forbids: [].}
- Adds a quadratic Bézier curve to the current sub-path. It requires two points: the first one is a control point and the second one is the end point. The starting point is the latest point in the current path, which can be changed using moveTo() before creating the quadratic Bézier curve. Source Edit
proc roundedRect(path: Path; rect: Rect; nw, ne, se, sw: float32; clockwise = true) {.inline, ...raises: [], tags: [], forbids: [].}
- Adds a rounded rectangle. Clockwise param can be used to subtract a rect from a path when using even-odd winding rule. Source Edit
proc roundedRect(path: Path; x, y, w, h, nw, ne, se, sw: float32; clockwise = true) {....raises: [], tags: [], forbids: [].}
- Adds a rounded rectangle. Clockwise param can be used to subtract a rect from a path when using even-odd winding rule. Source Edit
proc strokeOverlaps(path: Path; test: Vec2; transform = mat3(); ## Applied to the path, not the test point. strokeWidth: float32 = 1.0; lineCap = ButtCap; lineJoin = MiterJoin; miterLimit = defaultMiterLimit; dashes: seq[float32] = @[]): bool {....raises: [PixieError], tags: [], forbids: [].}
- Returns whether or not the specified point is inside the area contained by the stroking of a path. Source Edit
proc strokePath(image: Image; path: SomePath; paint: Paint; transform = mat3(); strokeWidth: float32 = 1.0; lineCap = ButtCap; lineJoin = MiterJoin; miterLimit = defaultMiterLimit; dashes: seq[float32] = @[]) {....raises: [PixieError].}
- Strokes a path. Source Edit