diff options
author | 2022-10-05 10:49:58 -0700 | |
---|---|---|
committer | 2022-10-05 10:49:58 -0700 | |
commit | 30432cbade3d9b25c4df62656a7494db3f4ea82a (patch) | |
tree | 186ca59e50caede84ede2e2381dc01dd0483806b /graphics/src/widget/canvas/fill.rs | |
parent | 6e7b3ced0b1daf368e44e181ecdb4ae529877eb6 (diff) | |
download | iced-30432cbade3d9b25c4df62656a7494db3f4ea82a.tar.gz iced-30432cbade3d9b25c4df62656a7494db3f4ea82a.tar.bz2 iced-30432cbade3d9b25c4df62656a7494db3f4ea82a.zip |
Readjusted namespaces, removed Geometry example as it's no longer relevant.
Diffstat (limited to 'graphics/src/widget/canvas/fill.rs')
-rw-r--r-- | graphics/src/widget/canvas/fill.rs | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/graphics/src/widget/canvas/fill.rs b/graphics/src/widget/canvas/fill.rs index 6f10505c..55cb3966 100644 --- a/graphics/src/widget/canvas/fill.rs +++ b/graphics/src/widget/canvas/fill.rs @@ -1,6 +1,8 @@ -use iced_native::Color; +//! Fill [crate::widget::canvas::Geometry] with a certain style. + use crate::gradient::Gradient; -use crate::shader::Shader; +use crate::layer::mesh; +use iced_native::Color; /// The style used to fill geometry. #[derive(Debug, Clone)] @@ -21,7 +23,7 @@ pub struct Fill<'a> { pub rule: FillRule, } -impl <'a> Default for Fill<'a> { +impl<'a> Default for Fill<'a> { fn default() -> Fill<'a> { Fill { style: Style::Solid(Color::BLACK), @@ -48,11 +50,11 @@ pub enum Style<'a> { Gradient(&'a Gradient), } -impl <'a> Into<Shader> for Style<'a> { - fn into(self) -> Shader { +impl<'a> Into<mesh::Style> for Style<'a> { + fn into(self) -> mesh::Style { match self { - Style::Solid(color) => Shader::Solid(color), - Style::Gradient(gradient) => gradient.clone().into() + Style::Solid(color) => mesh::Style::Solid(color), + Style::Gradient(gradient) => gradient.clone().into(), } } } |