Move mesh::Style to triangle and reuse it in fill and stroke
This commit is contained in:
parent
e0bb707f1e
commit
84d1b79fef
10 changed files with 72 additions and 98 deletions
|
|
@ -3,8 +3,11 @@ mod gradient;
|
|||
mod solid;
|
||||
|
||||
use crate::{program, Transformation};
|
||||
|
||||
use iced_graphics::layer::mesh::{self, Mesh};
|
||||
use iced_graphics::triangle;
|
||||
|
||||
use glow::HasContext;
|
||||
use iced_graphics::layer::{mesh, Mesh};
|
||||
use std::marker::PhantomData;
|
||||
|
||||
pub use iced_graphics::triangle::{Mesh2D, Vertex2D};
|
||||
|
|
@ -136,10 +139,10 @@ impl Pipeline {
|
|||
);
|
||||
|
||||
match mesh.style {
|
||||
mesh::Style::Solid(color) => {
|
||||
triangle::Style::Solid(color) => {
|
||||
self.programs.solid.use_program(gl, color, &transform);
|
||||
}
|
||||
mesh::Style::Gradient(gradient) => {
|
||||
triangle::Style::Gradient(gradient) => {
|
||||
self.programs
|
||||
.gradient
|
||||
.use_program(gl, gradient, &transform);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue