Skip to main content

Shape

Trait Shape 

Source
pub trait Shape {
    // Required method
    fn draw(&self, painter: &mut Painter<'_, '_>);
}
Expand description

Something that can be drawn on a Canvas.

You may implement your own canvas custom widgets by implementing this trait.

Required Methods§

Source

fn draw(&self, painter: &mut Painter<'_, '_>)

Draws this Shape using the given Painter.

This is the only method required to implement a custom widget that can be drawn on a Canvas.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§