Skip to content
draw_arc

draw_arc

Mojo function 🡭

draw_arc

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

The arc’s curved boundary only, no radii back to center: hard-edged, ~1px, via draw_polyline over _arc_points’ samples. For a solid wedge see fill_arc; for a ring segment, fill_ring_sector.

Args:

  • canvas (Canvas): Canvas to draw into.
  • cx (Float64): Center x.
  • cy (Float64): Center y.
  • radius (Float64): Arc radius in pixels.
  • start_angle (Float64): Sweep start, radians, 0 pointing along +x.
  • end_angle (Float64): Sweep end, radians. Below start_angle sweeps the other way round, over the same points in reverse.
  • color (Color): Outline color.