aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2018-03-16 18:11:07 +0200
committerEli Zaretskii2018-06-02 12:21:23 +0300
commitc4db7662bb4740f069e494cfe632c76a0d21d6d7 (patch)
tree0c41b45abeb65dfd47d1a83c34e59d26adcb0133 /src
parenta6cf7be3f05418200453113c9bc99e057270aad3 (diff)
downloademacs-c4db7662bb4740f069e494cfe632c76a0d21d6d7.tar.gz
emacs-c4db7662bb4740f069e494cfe632c76a0d21d6d7.zip
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) (cherry picked from commit 33cba5405c724566673cf023513bfb1faa963bea)
Diffstat (limited to 'src')
-rw-r--r--src/xdisp.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index 4e3955ea61e..21fb6bca1d1 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -10175,9 +10175,14 @@ include the height of both, if present, in the return value. */)
10175 RESTORE_IT (&it, &it2, it2data); 10175 RESTORE_IT (&it, &it2, it2data);
10176 x = move_it_to (&it, end, to_x, max_y, -1, move_op); 10176 x = move_it_to (&it, end, to_x, max_y, -1, move_op);
10177 /* Add the width of the thing at TO, but only if we didn't 10177 /* Add the width of the thing at TO, but only if we didn't
10178 overshoot it; if we did, it is already accounted for. */ 10178 overshoot it; if we did, it is already accounted for. Also,
10179 account for the height of the thing at TO. */
10179 if (IT_CHARPOS (it) == end) 10180 if (IT_CHARPOS (it) == end)
10180 x += it.pixel_width; 10181 {
10182 x += it.pixel_width;
10183 it.max_ascent = max (it.max_ascent, it.ascent);
10184 it.max_descent = max (it.max_descent, it.descent);
10185 }
10181 } 10186 }
10182 if (!NILP (x_limit)) 10187 if (!NILP (x_limit))
10183 { 10188 {