diff options
author | Christian Duerr <contact@christianduerr.com> | 2017-12-20 01:33:00 +0100 |
---|---|---|
committer | Joe Wilm <jwilm@users.noreply.github.com> | 2017-12-22 13:18:08 -0800 |
commit | c9abf571f2a2dcc8fabef1a582acc26a6359c19f (patch) | |
tree | 7a353f3f49fd53b9cd6e71c265a2f8f1b2d82c5f | |
parent | 32cc53a901b24a683787d3417fd635fa06a278b6 (diff) | |
download | alacritty-c9abf571f2a2dcc8fabef1a582acc26a6359c19f.tar.gz alacritty-c9abf571f2a2dcc8fabef1a582acc26a6359c19f.zip |
Change LoadGlyph in LoaderApi to match RenderApi
-rw-r--r-- | src/renderer/mod.rs | 10 |
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) } } |