From 79150f6086286294c9e5ed56df5b14c87129cde6 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 8 Sep 2017 16:15:23 +0300 Subject: [PATCH] Fix line-pixel-height for lines of variable height * src/xdisp.c (Fline_pixel_height): Start moving from the beginning of the screen line, to capture the full metrics of the line. (Bug#28391) --- src/xdisp.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/xdisp.c b/src/xdisp.c index ad9b29835e7..5e8188cacb9 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -1195,6 +1195,10 @@ Value is the height in pixels of the line at point. */) } SET_TEXT_POS (pt, PT, PT_BYTE); start_display (&it, w, pt); + /* Start from the beginning of the screen line, to make sure we + traverse all of its display elements, and thus capture the + correct metrics. */ + move_it_by_lines (&it, 0); it.vpos = it.current_y = 0; last_height = 0; result = make_number (line_bottom_y (&it)); -- 2.39.5