MCPcopy Create free account
hub / github.com/Logicalshift/flo_draw / main

Function main

draw/examples/circle.rs:7–30  ·  view source on GitHub ↗

Displays a filled circle

()

Source from the content-addressed store, hash-verified

5/// Displays a filled circle
6///
7pub 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}

Callers

nothing calls this directly

Calls 12

with_2d_graphicsFunction · 0.85
create_drawing_windowFunction · 0.85
canvas_heightMethod · 0.80
center_regionMethod · 0.80
new_pathMethod · 0.80
circleMethod · 0.80
fill_colorMethod · 0.80
line_widthMethod · 0.80
stroke_colorMethod · 0.80
drawMethod · 0.45
fillMethod · 0.45
strokeMethod · 0.45

Tested by

no test coverage detected