diff options
author | 2022-09-30 10:27:00 -0700 | |
---|---|---|
committer | 2022-09-30 10:27:00 -0700 | |
commit | 5d0fffc626928177239336757507b986b081b878 (patch) | |
tree | 03c6d1c8ab957f3cb5115fe6c75df65110a0ad64 /graphics/src/shader.rs | |
parent | e25f3d3dea2d2c1ba7d2778948443df2745084be (diff) | |
download | iced-5d0fffc626928177239336757507b986b081b878.tar.gz iced-5d0fffc626928177239336757507b986b081b878.tar.bz2 iced-5d0fffc626928177239336757507b986b081b878.zip |
Fixed some importing issues since you can use a Shader::Gradient outside a Canvas widget, where it was previously only accessible.
Diffstat (limited to 'graphics/src/shader.rs')
-rw-r--r-- | graphics/src/shader.rs | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/graphics/src/shader.rs b/graphics/src/shader.rs index b9071c74..69679e9b 100644 --- a/graphics/src/shader.rs +++ b/graphics/src/shader.rs @@ -1,8 +1,7 @@ //! Supported shaders; -use crate::{Color, widget}; +use crate::Color; use crate::gradient::Gradient; -use crate::widget::canvas::{FillStyle, StrokeStyle}; #[derive(Debug, Clone)] /// Supported shaders for primitives. @@ -13,28 +12,10 @@ pub enum Shader { Gradient(Gradient) } -impl <'a> Into<Shader> for StrokeStyle<'a> { +impl <'a> Into<Shader> for Gradient { fn into(self) -> Shader { match self { - StrokeStyle::Solid(color) => Shader::Solid(color), - StrokeStyle::Gradient(gradient) => gradient.clone().into() - } - } -} - -impl <'a> Into<Shader> for FillStyle<'a> { - fn into(self) -> Shader { - match self { - FillStyle::Solid(color) => Shader::Solid(color), - FillStyle::Gradient(gradient) => gradient.clone().into() - } - } -} - -impl <'a> Into<Shader> for widget::canvas::Gradient { - fn into(self) -> Shader { - match self { - widget::canvas::Gradient::Linear(linear) => { + Gradient::Linear(linear) => { Shader::Gradient(Gradient::Linear(linear)) } } |