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,7 +3,8 @@ use crate::{settings, Transformation};
|
|||
use core::fmt;
|
||||
use std::fmt::Formatter;
|
||||
|
||||
use iced_graphics::layer::{mesh, Mesh};
|
||||
use iced_graphics::layer::mesh::{self, Mesh};
|
||||
use iced_graphics::triangle;
|
||||
use iced_graphics::Size;
|
||||
|
||||
use crate::buffer::r#static::Buffer;
|
||||
|
|
@ -141,10 +142,10 @@ impl Pipeline {
|
|||
|
||||
//push uniform data to CPU buffers
|
||||
match mesh.style {
|
||||
mesh::Style::Solid(color) => {
|
||||
triangle::Style::Solid(color) => {
|
||||
self.pipelines.solid.push(transform, color);
|
||||
}
|
||||
mesh::Style::Gradient(gradient) => {
|
||||
triangle::Style::Gradient(gradient) => {
|
||||
self.pipelines.gradient.push(transform, gradient);
|
||||
}
|
||||
}
|
||||
|
|
@ -199,7 +200,7 @@ impl Pipeline {
|
|||
);
|
||||
|
||||
match mesh.style {
|
||||
mesh::Style::Solid(_) => {
|
||||
triangle::Style::Solid(_) => {
|
||||
if !last_is_solid.unwrap_or(false) {
|
||||
self.pipelines
|
||||
.solid
|
||||
|
|
@ -215,7 +216,7 @@ impl Pipeline {
|
|||
|
||||
num_solids += 1;
|
||||
}
|
||||
mesh::Style::Gradient(_) => {
|
||||
triangle::Style::Gradient(_) => {
|
||||
if last_is_solid.unwrap_or(true) {
|
||||
self.pipelines
|
||||
.gradient
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue