Skip to content

Commit

Permalink
Speculative fix for prompt being truncated on stockterminal display
Browse files Browse the repository at this point in the history
  • Loading branch information
sde1000 committed May 19, 2024
1 parent c2791b0 commit b22d2ec
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion quicktill/ui_gtk.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit b22d2ec

Please sign in to comment.