Remove Builder abstractions for gradients
This commit is contained in:
parent
6551a0b2ab
commit
4c1a082f04
15 changed files with 167 additions and 213 deletions
|
|
@ -1,8 +1,8 @@
|
|||
//! Fill [crate::widget::canvas::Geometry] with a certain style.
|
||||
use iced_core::Color;
|
||||
|
||||
pub use crate::geometry::Style;
|
||||
use crate::Gradient;
|
||||
|
||||
use crate::core::Color;
|
||||
use crate::gradient::{self, Gradient};
|
||||
|
||||
/// The style used to fill geometry.
|
||||
#[derive(Debug, Clone)]
|
||||
|
|
@ -50,6 +50,15 @@ impl From<Gradient> for Fill {
|
|||
}
|
||||
}
|
||||
|
||||
impl From<gradient::Linear> for Fill {
|
||||
fn from(gradient: gradient::Linear) -> Self {
|
||||
Fill {
|
||||
style: Style::Gradient(Gradient::Linear(gradient)),
|
||||
..Default::default()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// The fill rule defines how to determine what is inside and what is outside of
|
||||
/// a shape.
|
||||
///
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue