]> git.eshelyaron.com Git - emacs.git/commitdiff
Another followup to fixing 'window-text-pixel-width'
authorEli Zaretskii <eliz@gnu.org>
Fri, 16 Mar 2018 16:11:07 +0000 (18:11 +0200)
committerEli Zaretskii <eliz@gnu.org>
Sat, 2 Jun 2018 09:21:23 +0000 (12:21 +0300)
* src/xdisp.c (Fwindow_text_pixel_size): Adjust the return value
when we stop one buffer position short of TO.  (Bug#30746)

(cherry picked from commit 33cba5405c724566673cf023513bfb1faa963bea)

src/xdisp.c

index 4e3955ea61eeb9f1b71bc84a51255d78f80ec209..21fb6bca1d1a2c56d955e8c929e79c7afb6b9a22 100644 (file)
@@ -10175,9 +10175,14 @@ include the height of both, if present, in the return value.  */)
       RESTORE_IT (&it, &it2, it2data);
       x = move_it_to (&it, end, to_x, max_y, -1, move_op);
       /* Add the width of the thing at TO, but only if we didn't
-        overshoot it; if we did, it is already accounted for.  */
+        overshoot it; if we did, it is already accounted for.  Also,
+        account for the height of the thing at TO.  */
       if (IT_CHARPOS (it) == end)
-       x += it.pixel_width;
+       {
+         x += it.pixel_width;
+         it.max_ascent = max (it.max_ascent, it.ascent);
+         it.max_descent = max (it.max_descent, it.descent);
+       }
     }
   if (!NILP (x_limit))
     {