From b22d2ecf2545bfb42aa45e383a638d111c6f1adc Mon Sep 17 00:00:00 2001 From: Stephen Early Date: Sun, 19 May 2024 11:04:45 +0100 Subject: [PATCH] Speculative fix for prompt being truncated on stockterminal display --- quicktill/ui_gtk.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/quicktill/ui_gtk.py b/quicktill/ui_gtk.py index 9334b07..d84ebe2 100644 --- a/quicktill/ui_gtk.py +++ b/quicktill/ui_gtk.py @@ -349,6 +349,7 @@ def __init__(self, drawable, height, width, y, x, self.fontwidth = metrics.get_approximate_digit_width() // Pango.SCALE self.ascent = metrics.get_ascent() // Pango.SCALE self.descent = metrics.get_descent() // Pango.SCALE + self.pitch_adjust = pitch_adjust self.fontheight = self.ascent + self.descent + pitch_adjust super().__init__( drawable, height * self.fontheight, width * self.fontwidth, @@ -453,7 +454,7 @@ def wrapstr(self, y, x, width, s, colour=None, display=True): layout.set_font_description(self.font) layout.set_width(width * self.fontwidth * Pango.SCALE) width, height = layout.get_pixel_size() - lines = height // self.fontheight + lines = height // (self.fontheight - self.pitch_adjust) if display: ctx.move_to(x * self.fontwidth, y * self.fontheight) PangoCairo.show_layout(ctx, layout)