Skip to content
fill_arc_aa

fill_arc_aa

Mojo function 🡭

fill_arc_aa

fn def fill_arc_aa(mut canvas: Canvas, cx: Float64, cy: Float64, radius: Float64, start_angle: Float64, end_angle: Float64, color: Color, supersample: Int = Int(4))

Anti-aliased pie-slice wedge: supersampled analytic coverage, testing each sub-sample against the wedge’s exact definition – within radius of center and within the angle span (_angle_in_span) – rather than rasterizing a flattened polygon.

Scans _arc_bounds’ tight box, expanded 1px for the AA sampling margin.

Args:

  • canvas (Canvas): Canvas to fill into.
  • cx (Float64): Center x.
  • cy (Float64): Center y.
  • radius (Float64): Wedge radius in pixels.
  • start_angle (Float64): Sweep start, radians, 0 pointing along +x.
  • end_angle (Float64): Sweep end, radians. Must be >= start_angle.
  • color (Color): Fill color.
  • supersample (Int): Sub-pixel grid side length per pixel (N -> N*N samples).