emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master 966b73b: Avoid errors in posn-at-point for large im


From: Eli Zaretskii
Subject: [Emacs-diffs] master 966b73b: Avoid errors in posn-at-point for large images
Date: Sat, 29 Oct 2016 14:40:43 +0000 (UTC)

branch: master
commit 966b73b3163416adf09bcff7418ecc9fa5a554c9
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    Avoid errors in posn-at-point for large images
    
    * src/keyboard.c (Fposn_at_point): If pos-visible-in-window-p
    returns a 6-member list for a partially visible glyph, pass the
    sum of Y and RTOP to posn-at-x-y, since that's where the visible
    portion of that glyph begins on display.  (Bug#24804)  (Bug#21832)
    (Bug#23809)
---
 src/keyboard.c |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/keyboard.c b/src/keyboard.c
index bb411e7..65938a5 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -10790,11 +10790,19 @@ The `posn-' functions access elements of such lists.  
*/)
     {
       Lisp_Object x = XCAR (tem);
       Lisp_Object y = XCAR (XCDR (tem));
+      Lisp_Object aux_info = XCDR (XCDR (tem));
+      int y_coord = XINT (y);
 
       /* Point invisible due to hscrolling?  X can be -1 when a
         newline in a R2L line overflows into the left fringe.  */
       if (XINT (x) < -1)
        return Qnil;
+      if (!NILP (aux_info) && y_coord < 0)
+       {
+         int rtop = XINT (XCAR (aux_info));
+
+         y = make_number (y_coord + rtop);
+       }
       tem = Fposn_at_x_y (x, y, window, Qnil);
     }
 



reply via email to

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