Skip to content

Instantly share code, notes, and snippets.

@merrickluo
Last active January 15, 2024 02:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save merrickluo/b4d53cf438da306c16dae699fae565a0 to your computer and use it in GitHub Desktop.
Save merrickluo/b4d53cf438da306c16dae699fae565a0 to your computer and use it in GitHub Desktop.
From d6729f5621abbf374a371dd6fdaa13d7dd209468 Mon Sep 17 00:00:00 2001
From: Merrick Luo <merrick@luois.me>
Date: Sun, 14 Jan 2024 19:02:47 +0800
Subject: [PATCH] Make line spacing centered
---
src/xdisp.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/src/xdisp.c b/src/xdisp.c
index 2d85a991e77..2bce1c55d70 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -23338,7 +23338,10 @@ append_space_for_newline (struct it *it, bool default_face_p)
}
if (extra_line_spacing > 0)
{
- it->descent += extra_line_spacing;
+ int spacing = extra_line_spacing;
+ it->ascent += spacing;
+ it->descent += spacing;
+
if (extra_line_spacing > it->max_extra_line_spacing)
it->max_extra_line_spacing = extra_line_spacing;
}
@@ -32662,7 +32665,10 @@ gui_produce_glyphs (struct it *it)
if (extra_line_spacing > 0)
{
- it->descent += extra_line_spacing;
+ int spacing = extra_line_spacing;
+ it->ascent += spacing;
+ it->descent += spacing;
+
if (extra_line_spacing > it->max_extra_line_spacing)
it->max_extra_line_spacing = extra_line_spacing;
}
--
2.41.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment