1
0
Fork 0
mirror of https://github.com/alacritty/alacritty.git synced 2024-11-11 13:51:01 -05:00

Change LoadGlyph in LoaderApi to match RenderApi

This commit is contained in:
Christian Duerr 2017-12-20 01:33:00 +01:00 committed by Joe Wilm
parent 32cc53a901
commit c9abf571f2

View file

@ -873,10 +873,12 @@ impl<'a> LoadGlyph for LoaderApi<'a> {
match self.atlas[*self.current_atlas].insert(rasterized, &mut self.active_tex) {
Ok(glyph) => glyph,
Err(_) => {
let atlas = Atlas::new(ATLAS_SIZE);
*self.active_tex = 0; // Atlas::new binds a texture. Ugh this is sloppy.
*self.current_atlas = 0;
self.atlas.insert(0, atlas);
*self.current_atlas += 1;
if *self.current_atlas == self.atlas.len() {
let atlas = Atlas::new(ATLAS_SIZE);
*self.active_tex = 0; // Atlas::new binds a texture. Ugh this is sloppy.
self.atlas.push(atlas);
}
self.load_glyph(rasterized)
}
}