Skip to content
fill_arc

fill_arc

Mojo function 🡭

fill_arc

fn def fill_arc(mut canvas: Canvas, cx: Float64, cy: Float64, radius: Float64, start_angle: Float64, end_angle: Float64, color: Color)

A solid pie-slice wedge: the arc plus two straight radii back to the center, filled. Samples the arc (_arc_points), appends the center point to close the shape, and hands it to fill_polygon.

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.