draw_polyline_aa
Mojo function 🡭
draw_polyline_aa
fn def draw_polyline_aa(mut canvas: Canvas, points: List[Point], color: Color, width: Float64 = 1, supersample: Int = Int(4), dashes: List[Float64] = List(), dash_offset: Float64 = 0, cap: LineCap = LineCap.ROUND, join: LineJoin = LineJoin.ROUND, miter_limit: Float64 = 4)Anti-aliased polyline; draw_polyline is the hard-edged version.
Args:
- canvas (
Canvas): Canvas to draw into. - points (
List[Point]): Vertices to connect, in order. - color (
Color): Line color. - width (
Float64): Stroke width in pixels. - supersample (
Int): Sub-pixel grid side length per pixel (N -> N*N samples) for the one stroke that still samples: a closed one whose inner ring inverts, the width being past the curve’s radius of curvature. Every other stroke rasterizes by exact area and ignores it. See_stroke_edges. - dashes (
List[Float64]): On/off segment lengths in pixels, cycled along the whole polyline. Empty (default) draws a solid line. - dash_offset (
Float64): Distance into the dash pattern the polyline starts at. - cap (
LineCap): How the two open ends are finished – see LineCap. - join (
LineJoin): How corners are turned – see LineJoin. - miter_limit (
Float64): Ratio past which a MITER join falls back to BEVEL, as a multiple of half the stroke width.
fn def draw_polyline_aa(mut canvas: Canvas, points: List[FPoint], color: Color, width: Float64 = 1, supersample: Int = Int(4), dashes: List[Float64] = List(), dash_offset: Float64 = 0, cap: LineCap = LineCap.ROUND, join: LineJoin = LineJoin.ROUND, miter_limit: Float64 = 4)draw_polyline_aa at sub-pixel vertices – the same polyline, placed to a fraction of a pixel rather than snapped to the pixel grid.
This is the real implementation; the whole-pixel overload above converts and calls it.
Args:
- canvas (
Canvas): Canvas to draw into. - points (
List[FPoint]): Vertices to connect, in order, at sub-pixel positions. - color (
Color): Line color. - width (
Float64): Stroke width in pixels. - supersample (
Int): Sub-pixel grid side length per pixel (N -> N*N samples) for the one stroke that still samples: a closed one whose inner ring inverts, the width being past the curve’s radius of curvature. Every other stroke rasterizes by exact area and ignores it. See_stroke_edges. - dashes (
List[Float64]): On/off segment lengths in pixels. Empty (default) draws a solid line. - dash_offset (
Float64): Distance into the dash pattern to start at. - cap (
LineCap): How the two open ends are finished – see LineCap. - join (
LineJoin): How corners are turned – see LineJoin. - miter_limit (
Float64): Ratio past which a MITER join falls back to BEVEL, as a multiple of half the stroke width.