From 799012c45d724c74503d77e81665c6744d0f8918 Mon Sep 17 00:00:00 2001 From: Jay Pavlina Date: Mon, 5 Dec 2022 23:23:16 +0000 Subject: [PATCH] Remove `TextError::ExceedMaxTextAtlases(usize)` variant (#6796) # Objective Fixes #6756 ## Solution Removes the variant wherever it's used Co-authored-by: Jay Pavlina --- crates/bevy_text/src/error.rs | 3 --- crates/bevy_text/src/text2d.rs | 3 +-- crates/bevy_ui/src/widget/text.rs | 3 +-- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/crates/bevy_text/src/error.rs b/crates/bevy_text/src/error.rs index 40fe1bca11ab73..1bb7cf12535814 100644 --- a/crates/bevy_text/src/error.rs +++ b/crates/bevy_text/src/error.rs @@ -7,7 +7,4 @@ pub enum TextError { NoSuchFont, #[error("failed to add glyph to newly-created atlas {0:?}")] FailedToAddGlyph(GlyphId), - // TODO this is not used. Remove it. - #[error("exceeded {0:?} available TextAltases for font. This can be caused by using an excessive number of font sizes or ui scaling. If you are changing font sizes or ui scaling dynamically consider using Transform::scale to modify the size. If you need more font sizes modify TextSettings.max_font_atlases." )] - ExceedMaxTextAtlases(usize), } diff --git a/crates/bevy_text/src/text2d.rs b/crates/bevy_text/src/text2d.rs index 3f6ac64012cb11..1143755e1931b9 100644 --- a/crates/bevy_text/src/text2d.rs +++ b/crates/bevy_text/src/text2d.rs @@ -207,8 +207,7 @@ pub fn update_text2d_layout( // queue for further processing queue.insert(entity); } - Err(e @ TextError::FailedToAddGlyph(_)) - | Err(e @ TextError::ExceedMaxTextAtlases(_)) => { + Err(e @ TextError::FailedToAddGlyph(_)) => { panic!("Fatal error when processing text: {e}."); } Ok(info) => { diff --git a/crates/bevy_ui/src/widget/text.rs b/crates/bevy_ui/src/widget/text.rs index 48e7b5a9246ce5..8455a9455af13c 100644 --- a/crates/bevy_ui/src/widget/text.rs +++ b/crates/bevy_ui/src/widget/text.rs @@ -135,8 +135,7 @@ pub fn text_system( // queue for further processing new_queue.push(entity); } - Err(e @ TextError::FailedToAddGlyph(_)) - | Err(e @ TextError::ExceedMaxTextAtlases(_)) => { + Err(e @ TextError::FailedToAddGlyph(_)) => { panic!("Fatal error when processing text: {e}."); } Ok(info) => {