• R/O
  • SSH

vim: 提交

Mirror of the Vim source from https://github.com/vim/vim


Commit MetaInfo

修订版28001013f467370c5d2c0ca652da52cec3982371 (tree)
时间2020-10-28 04:45:03
作者Bram Moolenaar <Bram@vim....>
CommiterBram Moolenaar

Log Message

patch 8.2.1913: GTK GUI: rounding for the cell height is too strict

Commit: https://github.com/vim/vim/commit/70cf45810cb9be5bd17074f7fb4ee238f2c4d57b
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Oct 27 20:43:26 2020 +0100

patch 8.2.1913: GTK GUI: rounding for the cell height is too strict
Problem: GTK GUI: rounding for the cell height is too strict.
Solution: Round up above 15/16 of a pixel. (closes https://github.com/vim/vim/issues/7203)

更改概述

差异

diff -r e4892caf7b5c -r 28001013f467 src/gui_gtk_x11.c
--- a/src/gui_gtk_x11.c Tue Oct 27 20:00:04 2020 +0100
+++ b/src/gui_gtk_x11.c Tue Oct 27 20:45:03 2020 +0100
@@ -4726,9 +4726,10 @@
47264726
47274727 pango_font_metrics_unref(metrics);
47284728
4729- // Round up, but not when the value is very close (e.g. 15.0009).
4730- gui.char_height = (ascent + descent + PANGO_SCALE - 3) / PANGO_SCALE
4731- + p_linespace;
4729+ // Round up when the value is more than about 1/16 of a pixel above a whole
4730+ // pixel (12.0624 becomes 12, 12.07 becomes 13). Then add 'linespace'.
4731+ gui.char_height = (ascent + descent + (PANGO_SCALE * 15) / 16)
4732+ / PANGO_SCALE + p_linespace;
47324733 // LINTED: avoid warning: bitwise operation on signed value
47334734 gui.char_ascent = PANGO_PIXELS(ascent + p_linespace * PANGO_SCALE / 2);
47344735
diff -r e4892caf7b5c -r 28001013f467 src/version.c
--- a/src/version.c Tue Oct 27 20:00:04 2020 +0100
+++ b/src/version.c Tue Oct 27 20:45:03 2020 +0100
@@ -751,6 +751,8 @@
751751 static int included_patches[] =
752752 { /* Add new patch number below this line */
753753 /**/
754+ 1913,
755+/**/
754756 1912,
755757 /**/
756758 1911,
Show on old repository browser