diff --git a/src/shapes.rs b/src/shapes.rs index 0b902b92..10329a42 100644 --- a/src/shapes.rs +++ b/src/shapes.rs @@ -204,15 +204,16 @@ pub fn draw_poly_lines( } /// Draws a solid circle centered at `[x, y]` with a given radius `r` and `color`. -pub fn draw_circle(x: f32, y: f32, r: f32, color: Color) { - draw_poly(x, y, 20, r, 0., color); +pub fn draw_circle(x: f32, y: f32, r: f32, color: Color, sides: Option) { + draw_poly(x, y, sides.unwrap_or(20), r, 0., color); } /// Draws a circle outline centered at `[x, y]` with a given radius, line `thickness` and `color`. -pub fn draw_circle_lines(x: f32, y: f32, r: f32, thickness: f32, color: Color) { - draw_poly_lines(x, y, 20, r, 0., thickness, color); +pub fn draw_circle_lines(x: f32, y: f32, r: f32, thickness: f32, color: Color, sides: Option) { + draw_poly_lines(x, y, sides.unwrap_or(20), r, 0., thickness, color); } + /// Draws a solid ellipse centered at `[x, y]` with a given size `[w, h]`, /// clockwise `rotation` (in degrees) and `color`. pub fn draw_ellipse(x: f32, y: f32, w: f32, h: f32, rotation: f32, color: Color) {