From 5d0fffc626928177239336757507b986b081b878 Mon Sep 17 00:00:00 2001 From: shan Date: Fri, 30 Sep 2022 10:27:00 -0700 Subject: Fixed some importing issues since you can use a Shader::Gradient outside a Canvas widget, where it was previously only accessible. --- graphics/src/shader.rs | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) (limited to 'graphics/src/shader.rs') 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 for StrokeStyle<'a> { +impl <'a> Into for Gradient { fn into(self) -> Shader { match self { - StrokeStyle::Solid(color) => Shader::Solid(color), - StrokeStyle::Gradient(gradient) => gradient.clone().into() - } - } -} - -impl <'a> Into for FillStyle<'a> { - fn into(self) -> Shader { - match self { - FillStyle::Solid(color) => Shader::Solid(color), - FillStyle::Gradient(gradient) => gradient.clone().into() - } - } -} - -impl <'a> Into for widget::canvas::Gradient { - fn into(self) -> Shader { - match self { - widget::canvas::Gradient::Linear(linear) => { + Gradient::Linear(linear) => { Shader::Gradient(Gradient::Linear(linear)) } } -- cgit