Fix documentation example of Canvas

... so it makes sense when seen from the `iced` crate.
This commit is contained in:
Héctor Ramón Jiménez 2022-11-03 05:59:13 +01:00
parent e9e2657791
commit a8c3b2ddf7
No known key found for this signature in database
GPG key ID: 140CC052C94F138E

View file

@ -45,12 +45,16 @@ use std::marker::PhantomData;
/// If you want to get a quick overview, here's how we can draw a simple circle:
///
/// ```no_run
/// // First, we define the data we need for drawing
/// use iced_graphics::{Color, Rectangle};
/// use iced_graphics::widget::Canvas;
/// use iced_graphics::widget::canvas::{Cursor, Frame, Geometry, Path, Program};
/// use iced_style::Theme;
/// # mod iced {
/// # pub mod widget {
/// # pub use iced_graphics::widget::canvas;
/// # }
/// # pub use iced_native::{Color, Rectangle, Theme};
/// # }
/// use iced::widget::canvas::{self, Canvas, Cursor, Fill, Frame, Geometry, Path, Program};
/// use iced::{Color, Rectangle, Theme};
///
/// // First, we define the data we need for drawing
/// #[derive(Debug)]
/// struct Circle {
/// radius: f32,