From bbb953610db425ad8593d5b10a9dac6c32fa25db Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Fri, 4 Dec 2020 22:36:20 -0800 Subject: [PATCH] wezterm: fix x-scale calculation Need to account for the number of cells occupied by the glyph, otherwise we'll always scale to a single cell for double width glyphs. refs: #342 --- wezterm-gui/src/gui/glyphcache.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wezterm-gui/src/gui/glyphcache.rs b/wezterm-gui/src/gui/glyphcache.rs index 3b9f5a736..4d434dc87 100644 --- a/wezterm-gui/src/gui/glyphcache.rs +++ b/wezterm-gui/src/gui/glyphcache.rs @@ -197,7 +197,8 @@ impl GlyphCache { } let y_scale = base_metrics.cell_height.get() / idx_metrics.cell_height.get(); - let x_scale = base_metrics.cell_width.get() / idx_metrics.cell_width.get(); + let x_scale = + base_metrics.cell_width.get() / (idx_metrics.cell_width.get() / info.num_cells as f64); let aspect = (idx_metrics.cell_height / idx_metrics.cell_width).get(); let is_square = aspect >= 0.9 && aspect <= 1.1;