Fix documentation example of Canvas
... so it makes sense when seen from the `iced` crate.
This commit is contained in:
parent
e9e2657791
commit
a8c3b2ddf7
1 changed files with 9 additions and 5 deletions
|
|
@ -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:
|
/// If you want to get a quick overview, here's how we can draw a simple circle:
|
||||||
///
|
///
|
||||||
/// ```no_run
|
/// ```no_run
|
||||||
/// // First, we define the data we need for drawing
|
/// # mod iced {
|
||||||
/// use iced_graphics::{Color, Rectangle};
|
/// # pub mod widget {
|
||||||
/// use iced_graphics::widget::Canvas;
|
/// # pub use iced_graphics::widget::canvas;
|
||||||
/// use iced_graphics::widget::canvas::{Cursor, Frame, Geometry, Path, Program};
|
/// # }
|
||||||
/// use iced_style::Theme;
|
/// # 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)]
|
/// #[derive(Debug)]
|
||||||
/// struct Circle {
|
/// struct Circle {
|
||||||
/// radius: f32,
|
/// radius: f32,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue