summaryrefslogtreecommitdiffstats
path: root/src/renderer/mod.rs
diff options
context:
space:
mode:
authorChristian Duerr <contact@christianduerr.com>2017-12-20 01:33:00 +0100
committerJoe Wilm <jwilm@users.noreply.github.com>2017-12-22 13:18:08 -0800
commitc9abf571f2a2dcc8fabef1a582acc26a6359c19f (patch)
tree7a353f3f49fd53b9cd6e71c265a2f8f1b2d82c5f /src/renderer/mod.rs
parent32cc53a901b24a683787d3417fd635fa06a278b6 (diff)
Change LoadGlyph in LoaderApi to match RenderApi
Diffstat (limited to 'src/renderer/mod.rs')
-rw-r--r--src/renderer/mod.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/renderer/mod.rs b/src/renderer/mod.rs
index e6d33c9b..d510692c 100644
--- a/src/renderer/mod.rs
+++ b/src/renderer/mod.rs
@@ -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)
}
}