From 764db69dd06b794074561e3830fdf02e67698445 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 5 Feb 2021 14:24:01 +0200 Subject: [PATCH] Fix last change in 'window-text-pixel-size' * src/xdisp.c (Fwindow_text_pixel_size): Fix last change: preserve the original Y coordinate after start_display, instead of zeroing it out. Reported by martin rudalics . --- src/xdisp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/xdisp.c b/src/xdisp.c index 426c874cdb5..4db981aa655 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -10706,6 +10706,7 @@ include the height of both, if present, in the return value. */) itdata = bidi_shelve_cache (); start_display (&it, w, startp); + int start_y = it.current_y; /* It makes no sense to measure dimensions of region of text that crosses the point where bidi reordering changes scan direction. By using unidirectional movement here we at least support the use @@ -10726,7 +10727,7 @@ include the height of both, if present, in the return value. */) int start_x = it.current_x; int move_op = MOVE_TO_POS | MOVE_TO_Y; int to_x = -1; - it.current_y = 0; + it.current_y = start_y; /* If FROM is on a newline, pretend that we start at the beginning of the next line, because the newline takes no place on display. */ if (FETCH_BYTE (start) == '\n') -- 2.39.2