Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mockersf committed Jun 1, 2022
1 parent 56a560c commit 374735d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion crates/bevy_text/src/font_atlas_set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,13 @@ impl FontAtlasSet {
)
};
if !font_atlases.iter_mut().any(add_char_to_font_atlas) {
let glyph_max_size = glyph_texture
// Find the largest dimension of the glyph, either its width or its height
let glyph_max_size: u32 = glyph_texture
.texture_descriptor
.size
.height
.max(glyph_texture.texture_descriptor.size.width);
// Pick the smaller 2^n value greather than glyph_max_size, and at least 512
let containing = (1u32 << (32 - glyph_max_size.leading_zeros())).max(512) as f32;
font_atlases.push(FontAtlas::new(
textures,
Expand Down

0 comments on commit 374735d

Please sign in to comment.