From: Eli Zaretskii Date: Fri, 16 Mar 2018 16:11:07 +0000 (+0200) Subject: Another followup to fixing 'window-text-pixel-width' X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=7d929e5cb93166b0c2f095cff54df6c7ee1fe3c9;p=emacs.git Another followup to fixing 'window-text-pixel-width' * src/xdisp.c (Fwindow_text_pixel_size): Adjust the return value when we stop one buffer position short of TO. (Bug#30746) --- diff --git a/src/xdisp.c b/src/xdisp.c index b99990d1d45..424f1735b5c 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -10173,9 +10173,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)) {