Skip to content

Commit

Permalink
Remove TextError::ExceedMaxTextAtlases(usize) variant (bevyengine#6796
Browse files Browse the repository at this point in the history
)

# Objective

Fixes bevyengine#6756

## Solution

Removes the variant wherever it's used

Co-authored-by: Jay Pavlina <[email protected]>
  • Loading branch information
JayPavlina and JayPavlina committed Dec 5, 2022
1 parent 83e8224 commit e621acd
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 7 deletions.
3 changes: 0 additions & 3 deletions crates/bevy_text/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
}
3 changes: 1 addition & 2 deletions crates/bevy_text/src/text2d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
3 changes: 1 addition & 2 deletions crates/bevy_ui/src/widget/text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit e621acd

Please sign in to comment.