diff options
author | 2023-06-29 07:48:03 +0200 | |
---|---|---|
committer | 2023-06-29 07:48:03 +0200 | |
commit | fa5650cfd1115e6ccec2ad795cf58fd970d5b43c (patch) | |
tree | 90fa0706c8d28547fd4dae1000161082b52b9b27 /wgpu/src/primitive.rs | |
parent | 2128472c2a8afcb59927712497c4f613612e9dcc (diff) | |
download | iced-fa5650cfd1115e6ccec2ad795cf58fd970d5b43c.tar.gz iced-fa5650cfd1115e6ccec2ad795cf58fd970d5b43c.tar.bz2 iced-fa5650cfd1115e6ccec2ad795cf58fd970d5b43c.zip |
Decouple `Mesh` primitives from main `Primitive` type
Diffstat (limited to 'wgpu/src/primitive.rs')
-rw-r--r-- | wgpu/src/primitive.rs | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/wgpu/src/primitive.rs b/wgpu/src/primitive.rs index 2e31cd53..a8f1119c 100644 --- a/wgpu/src/primitive.rs +++ b/wgpu/src/primitive.rs @@ -1,3 +1,17 @@ +use crate::core::Rectangle; +use crate::graphics::{Damage, Mesh}; + pub type Primitive = crate::graphics::Primitive<Custom>; -pub type Custom = (); +#[derive(Debug, Clone, PartialEq)] +pub enum Custom { + Mesh(Mesh), +} + +impl Damage for Custom { + fn bounds(&self) -> Rectangle { + match self { + Self::Mesh(mesh) => mesh.bounds(), + } + } +} |