From 30885b85f92e2cedebe67aab7e6da3585cd6ec57 Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Sat, 13 Mar 2021 12:58:17 +0100 Subject: [PATCH] Derive PartialEq for Vertex, Mesh, Row, Galley and Shape --- epaint/src/mesh.rs | 4 ++-- epaint/src/shape.rs | 2 +- epaint/src/text/galley.rs | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/epaint/src/mesh.rs b/epaint/src/mesh.rs index d9b2441e..a5239aab 100644 --- a/epaint/src/mesh.rs +++ b/epaint/src/mesh.rs @@ -5,7 +5,7 @@ use emath::*; /// /// Should be friendly to send to GPU as is. #[repr(C)] -#[derive(Clone, Copy, Debug, Default)] +#[derive(Clone, Copy, Debug, Default, PartialEq)] pub struct Vertex { /// Logical pixel coordinates (points). /// (0,0) is the top left corner of the screen. @@ -21,7 +21,7 @@ pub struct Vertex { } /// Textured triangles in two dimensions. -#[derive(Clone, Debug, Default)] +#[derive(Clone, Debug, Default, PartialEq)] pub struct Mesh { /// Draw as triangles (i.e. the length is always multiple of three). /// diff --git a/epaint/src/shape.rs b/epaint/src/shape.rs index 9ca42c90..e1580d3b 100644 --- a/epaint/src/shape.rs +++ b/epaint/src/shape.rs @@ -7,7 +7,7 @@ use emath::*; /// A paint primitive such as a circle or a piece of text. /// Coordinates are all screen space points (not physical pixels). #[must_use = "Add a Shape to a Painter"] -#[derive(Clone, Debug)] +#[derive(Clone, Debug, PartialEq)] pub enum Shape { /// Paint nothing. This can be useful as a placeholder. Noop, diff --git a/epaint/src/text/galley.rs b/epaint/src/text/galley.rs index 6982bf0f..cd3f4b4a 100644 --- a/epaint/src/text/galley.rs +++ b/epaint/src/text/galley.rs @@ -23,7 +23,7 @@ use super::cursor::*; use emath::{pos2, NumExt, Rect, Vec2}; /// A collection of text locked into place. -#[derive(Clone, Debug, Default)] +#[derive(Clone, Debug, Default, PartialEq)] pub struct Galley { /// The full text, including any an all `\n`. pub text: String, @@ -39,7 +39,7 @@ pub struct Galley { } /// A typeset piece of text on a single row. -#[derive(Clone, Debug)] +#[derive(Clone, Debug, PartialEq)] pub struct Row { /// The start of each character, probably starting at zero. /// The last element is the end of the last character.