]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 8.2.0857: GTK cell height can be a pixel too much v8.2.0857
authorBram Moolenaar <Bram@vim.org>
Sun, 31 May 2020 11:53:04 +0000 (13:53 +0200)
committerBram Moolenaar <Bram@vim.org>
Sun, 31 May 2020 11:53:04 +0000 (13:53 +0200)
Problem:    GTK cell height can be a pixel too much.
Solution:   Subtract 3 instead of 1 when rounding. (closes #6168)

src/gui_gtk_x11.c
src/version.c

index 96e70a88e57763db1e23be905b2dd43928106b81..a5af3fa21cbbabdfab6d19f07ba0bf6e3dd76191 100644 (file)
@@ -4711,7 +4711,8 @@ gui_mch_adjust_charheight(void)
 
     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);
index c4728196e4c68fadb44ae1a033401ba8c1fa7920..5bd8609c9acdf23966d57ab97e720e99219a4538 100644 (file)
@@ -746,6 +746,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    857,
 /**/
     856,
 /**/