emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs-26 c4db766: Another followup to fixing 'window-text-


From: Eli Zaretskii
Subject: [Emacs-diffs] emacs-26 c4db766: Another followup to fixing 'window-text-pixel-width'
Date: Sat, 2 Jun 2018 05:22:27 -0400 (EDT)

branch: emacs-26
commit c4db7662bb4740f069e494cfe632c76a0d21d6d7
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    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)
---
 src/xdisp.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/xdisp.c b/src/xdisp.c
index 4e3955e..21fb6bc 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -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))
     {



reply via email to

[Prev in Thread] Current Thread [Next in Thread]