diff options
| author | Eli Zaretskii | 2018-03-16 18:11:07 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2018-03-16 18:11:07 +0200 |
| commit | 33cba5405c724566673cf023513bfb1faa963bea (patch) | |
| tree | dc0b13aa23783c7fe084f4f89f051178d3bed036 /src | |
| parent | 2d0853f62ac65f974f25887f69506bfe923bf14b (diff) | |
| download | emacs-33cba5405c724566673cf023513bfb1faa963bea.tar.gz emacs-33cba5405c724566673cf023513bfb1faa963bea.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)
Diffstat (limited to 'src')
| -rw-r--r-- | src/xdisp.c | 9 |
1 files changed, 7 insertions, 2 deletions
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. */) | |||
| 10173 | RESTORE_IT (&it, &it2, it2data); | 10173 | RESTORE_IT (&it, &it2, it2data); |
| 10174 | x = move_it_to (&it, end, to_x, max_y, -1, move_op); | 10174 | x = move_it_to (&it, end, to_x, max_y, -1, move_op); |
| 10175 | /* Add the width of the thing at TO, but only if we didn't | 10175 | /* Add the width of the thing at TO, but only if we didn't |
| 10176 | overshoot it; if we did, it is already accounted for. */ | 10176 | overshoot it; if we did, it is already accounted for. Also, |
| 10177 | account for the height of the thing at TO. */ | ||
| 10177 | if (IT_CHARPOS (it) == end) | 10178 | if (IT_CHARPOS (it) == end) |
| 10178 | x += it.pixel_width; | 10179 | { |
| 10180 | x += it.pixel_width; | ||
| 10181 | it.max_ascent = max (it.max_ascent, it.ascent); | ||
| 10182 | it.max_descent = max (it.max_descent, it.descent); | ||
| 10183 | } | ||
| 10179 | } | 10184 | } |
| 10180 | if (!NILP (x_limit)) | 10185 | if (!NILP (x_limit)) |
| 10181 | { | 10186 | { |