patch 8.2.0857: GTK cell height can be a pixel too much
Problem: GTK cell height can be a pixel too much.
Solution: Subtract 3 instead of 1 when rounding. (closes #6168)
diff --git a/src/gui_gtk_x11.c b/src/gui_gtk_x11.c
index 96e70a8..a5af3fa 100644
--- a/src/gui_gtk_x11.c
+++ b/src/gui_gtk_x11.c
@@ -4711,7 +4711,8 @@
pango_font_metrics_unref(metrics);
- gui.char_height = (ascent + descent + PANGO_SCALE - 1) / PANGO_SCALE
+ // Round up, but not when the value is very close (e.g. 15.0009).
+ gui.char_height = (ascent + descent + PANGO_SCALE - 3) / PANGO_SCALE
+ p_linespace;
// LINTED: avoid warning: bitwise operation on signed value
gui.char_ascent = PANGO_PIXELS(ascent + p_linespace * PANGO_SCALE / 2);