Change LoadGlyph in LoaderApi to match RenderApi

This commit is contained in:
Christian Duerr authored and Joe Wilm committed 2017-12-22 13:18:08 -08:00
1 parent 32cc53a901
commit c9abf571f2
1 file changed
+6 -4
+6 -4
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)
}
}