fill_path_aa
Mojo function 🡭
fill_path_aa
fn def fill_path_aa(mut canvas: Canvas, path: Path, color: Color, fill_rule: FillRule = FillRule.EVEN_ODD, supersample: Int = Int(4), curve_steps: Int = Int(0))Anti-aliased fill_path. Under FillRule.NONZERO every pixel gets its exact covered area (256 levels, canvas.aa_area); under EVEN_ODD every pixel near the path’s flattened outline samples an NxN sub-pixel grid and the covered fraction becomes its alpha. Each output pixel is visited exactly once.
Multi-sub-path hole-punching, and union-filling under FillRule.NONZERO, work as in fill_path: every sub-path’s winding contribution is combined before the fill rule is applied, rather than per-sub-path independently.
Args:
- canvas (
Canvas): Canvas to fill into. - path (
Path): Path to fill. - color (
Color): Fill color. - fill_rule (
FillRule): EVEN_ODD (default) or NONZERO – see FillRule. - supersample (
Int): Sub-pixel grid side length per pixel (N -> N*N samples) under EVEN_ODD. A NONZERO fill rasterizes by exact area (canvas.aa_area) and ignores it. - curve_steps (
Int): Straight-line segments per quad/cubic Bezier; 0 (the default) chooses per segment.