From 1f93c7b0b622408e07bc7f8a4e0da16141b92b73 Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Fri, 7 Jan 2022 15:22:21 +0100 Subject: [PATCH] Implement Clone & PartialEq on RichText WidgetTextJob WidgetTextGalley --- egui/src/widget_text.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/egui/src/widget_text.rs b/egui/src/widget_text.rs index f2451d71..acd77878 100644 --- a/egui/src/widget_text.rs +++ b/egui/src/widget_text.rs @@ -9,7 +9,7 @@ use crate::{ /// /// The style choices (font, color) are applied to the entire text. /// For more detailed control, use [`crate::text::LayoutJob`] instead. -#[derive(Default)] +#[derive(Clone, Default, PartialEq)] pub struct RichText { text: String, text_style: Option, @@ -555,6 +555,7 @@ impl From> for WidgetText { // ---------------------------------------------------------------------------- +#[derive(Clone, PartialEq)] pub struct WidgetTextJob { pub job: LayoutJob, pub job_has_color: bool, @@ -574,6 +575,7 @@ impl WidgetTextJob { // ---------------------------------------------------------------------------- /// Text that has been layed out and ready to be painted. +#[derive(Clone, PartialEq)] pub struct WidgetTextGalley { pub galley: Arc, pub galley_has_color: bool,