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, diff --git a/epaint/src/texture_atlas.rs b/epaint/src/texture_atlas.rs index 054a2c1c..a79501aa 100644 --- a/epaint/src/texture_atlas.rs +++ b/epaint/src/texture_atlas.rs @@ -6,7 +6,9 @@ pub struct FontImage { pub version: u64, pub width: usize, pub height: usize, - /// White color with the given alpha (linear space 0-255). + /// The alpha (linear space 0-255) of something white. + /// + /// One byte per pixel. Often you want to use [`Self::srgba_pixels`] instead. pub pixels: Vec, } diff --git a/epi/src/lib.rs b/epi/src/lib.rs index 7cd0bba2..b780b2eb 100644 --- a/epi/src/lib.rs +++ b/epi/src/lib.rs @@ -160,8 +160,13 @@ pub trait App { } /// The size limit of the web app canvas. + /// + /// By default the size if limited to 1024x2048. + /// + /// A larger canvas can lead to bad frame rates on some browsers on some platforms. + /// In particular, Firefox on Mac and Linux is really bad at handling large WebGL canvases: + /// (unfixed since 2014). fn max_size_points(&self) -> egui::Vec2 { - // Some browsers get slow with huge WebGL canvases, so we limit the size: egui::Vec2::new(1024.0, 2048.0) }