From fa5650cfd1115e6ccec2ad795cf58fd970d5b43c Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Thu, 29 Jun 2023 07:48:03 +0200 Subject: Decouple `Mesh` primitives from main `Primitive` type --- wgpu/src/primitive.rs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'wgpu/src/primitive.rs') 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; -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(), + } + } +} -- cgit