summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-05-31 13:53:04 +0200
committerBram Moolenaar <Bram@vim.org>2020-05-31 13:53:04 +0200
commit5cd1cb9ff9d04979ff4cbc36ca8416d83364505d (patch)
treed8e8508dc14849eedd34773baba99a2a5ef6b067
parent928eec649b8af389de0fdb7aba2034d27df3e058 (diff)
downloadvim-git-5cd1cb9ff9d04979ff4cbc36ca8416d83364505d.tar.gz
patch 8.2.0857: GTK cell height can be a pixel too muchv8.2.0857
Problem: GTK cell height can be a pixel too much. Solution: Subtract 3 instead of 1 when rounding. (closes #6168)
-rw-r--r--src/gui_gtk_x11.c3
-rw-r--r--src/version.c2
2 files changed, 4 insertions, 1 deletions
diff --git a/src/gui_gtk_x11.c b/src/gui_gtk_x11.c
index 96e70a88e..a5af3fa21 100644
--- a/src/gui_gtk_x11.c
+++ b/src/gui_gtk_x11.c
@@ -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);
diff --git a/src/version.c b/src/version.c
index c4728196e..5bd8609c9 100644
--- a/src/version.c
+++ b/src/version.c
@@ -747,6 +747,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 857,
+/**/
856,
/**/
855,