From d1690886947a1be58accadc90ef76d7e227d6ef9 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Mon, 17 Jan 2022 09:24:23 -0700 Subject: [PATCH] fix clipping issue in fancy tab bar We budget size based on the x_advance, which can be 1 pixel less than the width of the glyph texture, so we could often end up omitting the last character in "Launcher" or "default" in the tab title or right status area. This commit uses x_advance in both places. --- wezterm-gui/src/termwindow/box_model.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wezterm-gui/src/termwindow/box_model.rs b/wezterm-gui/src/termwindow/box_model.rs index f162f6cc1..8e70b6904 100644 --- a/wezterm-gui/src/termwindow/box_model.rs +++ b/wezterm-gui/src/termwindow/box_model.rs @@ -812,7 +812,9 @@ impl super::TermWindow { let width = texture.coords.size.width as f32 * glyph.scale as f32; let height = texture.coords.size.height as f32 * glyph.scale as f32; - if pos_x + width > element.content_rect.max_x() { + if pos_x + glyph.x_advance.get() as f32 + > element.content_rect.max_x() + { break; }