mirror of
https://github.com/emilk/egui.git
synced 2026-06-26 22:53:14 -04:00
Derive PartialEq for Vertex, Mesh, Row, Galley and Shape
This commit is contained in:
@@ -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).
|
||||
///
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user