Canvas

Canvas example

The Canvas widget allows you to draw custom shapes on the screen without creating your own widget.

Enable the canvas feature to use it.

Canvas::new(|scene, _| {
    scene.stroke(
        &Stroke::new(10.0),
        Affine::default(),
        &Brush::Solid(palette::css::GREEN),
        None,
        &Circle::new(Point::new(100.0, 100.0), 50.0),
    );
})

For a full example, see the canvas example.