diff options
author | 2024-04-05 23:59:21 +0200 | |
---|---|---|
committer | 2024-04-05 23:59:21 +0200 | |
commit | 6d3e1d835e1688fbc58622a03a784ed25ed3f0e1 (patch) | |
tree | b1a14b0ec7b2da4368d5c98850fe9e9eebc5490a /graphics/src/mesh.rs | |
parent | 4a356cfc16f3b45d64826732009d9feeac016b28 (diff) | |
download | iced-6d3e1d835e1688fbc58622a03a784ed25ed3f0e1.tar.gz iced-6d3e1d835e1688fbc58622a03a784ed25ed3f0e1.tar.bz2 iced-6d3e1d835e1688fbc58622a03a784ed25ed3f0e1.zip |
Decouple caching from layering and simplify everything
Diffstat (limited to '')
-rw-r--r-- | graphics/src/mesh.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/graphics/src/mesh.rs b/graphics/src/mesh.rs index d3e7ffaf..76602319 100644 --- a/graphics/src/mesh.rs +++ b/graphics/src/mesh.rs @@ -1,6 +1,6 @@ //! Draw triangles! use crate::color; -use crate::core::{Rectangle, Size, Transformation}; +use crate::core::{Rectangle, Transformation}; use crate::gradient; use bytemuck::{Pod, Zeroable}; @@ -16,8 +16,8 @@ pub enum Mesh { /// The [`Transformation`] for the vertices of the [`Mesh`]. transformation: Transformation, - /// The [`Size`] of the [`Mesh`]. - size: Size, + /// The clip bounds of the [`Mesh`]. + clip_bounds: Rectangle, }, /// A mesh with a gradient. Gradient { @@ -27,8 +27,8 @@ pub enum Mesh { /// The [`Transformation`] for the vertices of the [`Mesh`]. transformation: Transformation, - /// The [`Size`] of the [`Mesh`]. - size: Size, + /// The clip bounds of the [`Mesh`]. + clip_bounds: Rectangle, }, } @@ -53,15 +53,15 @@ impl Mesh { pub fn clip_bounds(&self) -> Rectangle { match self { Self::Solid { - size, + clip_bounds, transformation, .. } | Self::Gradient { - size, + clip_bounds, transformation, .. - } => Rectangle::with_size(*size) * *transformation, + } => *clip_bounds * *transformation, } } } |