From 2b2e443c7bb09715d0fdef07e28e158d34424fdd Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Sat, 17 Feb 2018 12:17:36 -0800 Subject: [PATCH] fix glyph y scale for color emoji --- src/xwin.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/xwin.rs b/src/xwin.rs index 30ef4968b..e9407717b 100644 --- a/src/xwin.rs +++ b/src/xwin.rs @@ -191,6 +191,7 @@ struct GlyphKey { /// Caches a rendered glyph. /// The image data may be None for whitespace glyphs. +#[derive(Debug)] struct CachedGlyph { has_color: bool, x_offset: isize, @@ -758,8 +759,8 @@ impl<'a> TerminalWindow<'a> { (w as usize, h as usize) }; - let scale_y = glyph_height.min(self.cell_height) as f32 / self.cell_height as f32; - let scale_x = glyph.scale * (glyph_width as f32 / metric_width as f32); + let scale_y = glyph.scale * glyph_height as f32 / self.cell_height as f32; + let scale_x = glyph.scale * glyph_width as f32 / metric_width as f32; let draw_y = base_y - (glyph.y_offset as isize + glyph.bearing_y); let draw_x = x + glyph.x_offset as isize + glyph.bearing_x;