Fixed some importing issues since you can use a Shader::Gradient outside a Canvas widget, where it was previously only accessible.

This commit is contained in:
shan 2022-09-30 10:27:00 -07:00
parent e25f3d3dea
commit 5d0fffc626
11 changed files with 126 additions and 148 deletions

View file

@ -5,7 +5,6 @@
//! and more!
pub mod event;
pub mod gradient;
pub mod path;
mod cache;
@ -23,7 +22,6 @@ pub use event::Event;
pub use fill::{Fill, FillRule, FillStyle};
pub use frame::Frame;
pub use geometry::Geometry;
pub use gradient::Gradient;
pub use path::Path;
pub use program::Program;
pub use stroke::{LineCap, LineDash, LineJoin, Stroke, StrokeStyle};
@ -47,16 +45,12 @@ use std::marker::PhantomData;
/// If you want to get a quick overview, here's how we can draw a simple circle:
///
/// ```no_run
/// # 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
/// use iced_graphics::{Color, Rectangle};
/// use iced_graphics::widget::Canvas;
/// use iced_graphics::widget::canvas::{Cursor, Frame, Geometry, Path, Program};
/// use iced_style::Theme;
///
/// #[derive(Debug)]
/// struct Circle {
/// radius: f32,