Skip to content

Commit 04bab6c

Browse files
committed
document alternatives for higher-precision circles
1 parent d94bc7a commit 04bab6c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/shapes.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,11 +249,17 @@ pub fn draw_poly_lines(
249249
}
250250

251251
/// Draws a solid circle centered at `[x, y]` with a given radius `r` and `color`.
252+
///
253+
/// This is not a perfect circle, but only a polygon approximation.
254+
/// If this is an issue for you, consider using `draw_poly(x, y, 255, r, 0., color)` instead.
252255
pub fn draw_circle(x: f32, y: f32, r: f32, color: Color) {
253256
draw_poly(x, y, 20, r, 0., color);
254257
}
255258

256259
/// Draws a circle outline centered at `[x, y]` with a given radius, line `thickness` and `color`.
260+
///
261+
/// This is not a perfect circle, but only a polygon approximation.
262+
/// If this is an issue for you, consider using `draw_poly_lines(x, y, 255, r, 0., thickness, color)` instead.
257263
pub fn draw_circle_lines(x: f32, y: f32, r: f32, thickness: f32, color: Color) {
258264
draw_poly_lines(x, y, 30, r, 0., thickness, color);
259265
}

0 commit comments

Comments
 (0)