-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix font atlas overflow #495
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general this looks good to me. Just a few small nit-picks. Thanks!
@@ -55,7 +57,13 @@ impl FontAtlasSet { | |||
let font_atlas = self |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: lets rename this font_atlases
now that its a vec
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure - makes sense
if let Some(outlined_glyph) = scaled_font.outline_glyph(glyph.clone()) { | ||
let glyph_texture = Font::get_outlined_glyph_texture(outlined_glyph); | ||
font_atlas.add_char(textures, texture_atlases, character, &glyph_texture); | ||
let add_char_to_fontatlas = |atlas: &mut FontAtlas| -> bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: as long as it is, naming conventions dictate that this should be add_char_to_font_atlas
:)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agreed - although I hate putting it into a Fn ... but clippy complained :-(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bawhaha yeah sometimes clippy is overly opinionated imo.
character, | ||
&glyph_texture, | ||
) { | ||
panic!("could not add character to newly created fontatlas"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: lets use type name casing here: FontAtlas
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure thing
Awesome. This is good to go. Thanks again! |
manage font_atlas overflow
This should fix the issue of overflowing (and panicing) font_atlasses.