Displays a filled circle
()
| 5 | /// Displays a filled circle |
| 6 | /// |
| 7 | pub fn main() { |
| 8 | with_2d_graphics(|| { |
| 9 | // Create a window |
| 10 | let canvas = create_drawing_window("Circle"); |
| 11 | |
| 12 | // Draw a circle |
| 13 | canvas.draw(|gc| { |
| 14 | // Set up the canvas |
| 15 | gc.canvas_height(1000.0); |
| 16 | gc.center_region(0.0, 0.0, 1000.0, 1000.0); |
| 17 | |
| 18 | // Draw a circle |
| 19 | gc.new_path(); |
| 20 | gc.circle(500.0, 500.0, 250.0); |
| 21 | |
| 22 | gc.fill_color(Color::Rgba(0.3, 0.6, 0.8, 1.0)); |
| 23 | gc.fill(); |
| 24 | |
| 25 | gc.line_width(6.0); |
| 26 | gc.stroke_color(Color::Rgba(0.0, 0.0, 0.0, 1.0)); |
| 27 | gc.stroke(); |
| 28 | }); |
| 29 | }); |
| 30 | } |
nothing calls this directly
no test coverage detected