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:
parent
e25f3d3dea
commit
5d0fffc626
11 changed files with 126 additions and 148 deletions
|
|
@ -16,12 +16,4 @@ pub struct Mesh2D {
|
|||
pub struct Vertex2D {
|
||||
/// The vertex position in 2D space.
|
||||
pub position: [f32; 2],
|
||||
}
|
||||
|
||||
/// Convert from lyon's position data to Iced's Vertex2D type.
|
||||
impl Vertex2D {
|
||||
/// Converts from [`lyon::math::Point`] to [`Vertex2D`]. Used for generating primitives.
|
||||
pub fn from(points: Vec<lyon::math::Point>) -> Vec<Vertex2D> {
|
||||
points.iter().map(|p| Vertex2D { position: [p.x, p.y]}).collect()
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue