1
0
mirror of https://github.com/emilk/egui.git synced 2026-06-26 22:53:14 -04:00

Document when Galleys get invalidated (#3024)

This commit is contained in:
Valentin
2023-08-10 13:11:56 +02:00
committed by GitHub
parent 8cdffc4e2d
commit b15e17587a

View File

@@ -310,7 +310,13 @@ impl Default for TextWrapping {
///
/// You can create a [`Galley`] using [`crate::Fonts::layout_job`];
///
/// This needs to be recreated if `pixels_per_point` (dpi scale) changes.
/// Needs to be recreated if the underlying font atlas texture changes, which
/// happens under the following conditions:
/// - `pixels_per_point` or `max_texture_size` change. These parameters are set
/// in [`crate::text::Fonts::begin_frame`]. When using `egui` they are set
/// from `egui::InputState` and can change at any time.
/// - The atlas has become full. This can happen any time a new glyph is added
/// to the atlas, which in turn can happen any time new text is laid out.
#[derive(Clone, Debug, PartialEq)]
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
pub struct Galley {