Expand max font atlas size from 8k to 16k (#5257)
When using fonts with an average of 50,000 characters, 'epaint texture atlas overflowed!' may be printed and cause problems. It is necessary to expand the max value related to texture. * Closes #5256 --------- Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
This commit is contained in:
parent
68352fc13e
commit
288c74e332
|
|
@ -633,7 +633,7 @@ impl FontsImpl {
|
|||
"pixels_per_point out of range: {pixels_per_point}"
|
||||
);
|
||||
|
||||
let texture_width = max_texture_side.at_most(8 * 1024);
|
||||
let texture_width = max_texture_side.at_most(16 * 1024);
|
||||
let initial_height = 32; // Keep initial font atlas small, so it is fast to upload to GPU. This will expand as needed anyways.
|
||||
let atlas = TextureAtlas::new([texture_width, initial_height]);
|
||||
|
||||
|
|
|
|||
|
|
@ -159,8 +159,8 @@ impl TextureAtlas {
|
|||
}
|
||||
|
||||
fn max_height(&self) -> usize {
|
||||
// the initial width is likely the max texture side size
|
||||
self.image.width()
|
||||
// the initial width is set to the max size
|
||||
self.image.height().max(self.image.width())
|
||||
}
|
||||
|
||||
/// When this get high, it might be time to clear and start over!
|
||||
|
|
|
|||
Loading…
Reference in New Issue