]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix last change in 'window-text-pixel-size'
authorEli Zaretskii <eliz@gnu.org>
Fri, 5 Feb 2021 12:24:01 +0000 (14:24 +0200)
committerEli Zaretskii <eliz@gnu.org>
Fri, 5 Feb 2021 12:24:01 +0000 (14:24 +0200)
* 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 <rudalics@gmx.at>.

src/xdisp.c

index 426c874cdb5a7ec07109847de0a2853fcbff165e..4db981aa655b383414cc7a98b22ca490255266ca 100644 (file)
@@ -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')