emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/src/xdisp.c


From: Kim F . Storm
Subject: [Emacs-diffs] Changes to emacs/src/xdisp.c
Date: Fri, 21 Jan 2005 20:41:37 -0500

Index: emacs/src/xdisp.c
diff -c emacs/src/xdisp.c:1.966 emacs/src/xdisp.c:1.967
*** emacs/src/xdisp.c:1.966     Wed Jan 19 10:05:28 2005
--- emacs/src/xdisp.c   Sat Jan 22 01:41:36 2005
***************
*** 1243,1257 ****
  }
  
  
! /* Return 1 if position CHARPOS is visible in window W.  Set *FULLY to
!    1 if POS is visible and the line containing POS is fully visible.
     EXACT_MODE_LINE_HEIGHTS_P non-zero means compute exact mode-line
     and header-lines heights.  */
  
  int
! pos_visible_p (w, charpos, fully, x, y, exact_mode_line_heights_p)
       struct window *w;
!      int charpos, *fully, *x, *y, exact_mode_line_heights_p;
  {
    struct it it;
    struct text_pos top;
--- 1243,1258 ----
  }
  
  
! /* Return 1 if position CHARPOS is visible in window W.
!    If visible, set *X and *Y to pixel coordinates of top left corner.
!    Set *RTOP and *RBOT to pixel height of an invisible area of glyph at POS.
     EXACT_MODE_LINE_HEIGHTS_P non-zero means compute exact mode-line
     and header-lines heights.  */
  
  int
! pos_visible_p (w, charpos, x, y, rtop, rbot, exact_mode_line_heights_p)
       struct window *w;
!      int charpos, *x, *y, *rtop, *rbot, exact_mode_line_heights_p;
  {
    struct it it;
    struct text_pos top;
***************
*** 1264,1270 ****
        set_buffer_internal_1 (XBUFFER (w->buffer));
      }
  
!   *fully = visible_p = 0;
    SET_TEXT_POS_FROM_MARKER (top, w->start);
  
    /* Compute exact mode line heights, if requested.  */
--- 1265,1271 ----
        set_buffer_internal_1 (XBUFFER (w->buffer));
      }
  
!   visible_p = 0;
    SET_TEXT_POS_FROM_MARKER (top, w->start);
  
    /* Compute exact mode line heights, if requested.  */
***************
*** 1295,1308 ****
        if (top_y < window_top_y)
        visible_p = bottom_y > window_top_y;
        else if (top_y < it.last_visible_y)
-       {
          visible_p = 1;
-         *fully = bottom_y <= it.last_visible_y;
-       }
        if (visible_p && x)
        {
          *x = it.current_x;
          *y = max (top_y + it.max_ascent - it.ascent, window_top_y);
        }
      }
    else if (it.current_y + it.max_ascent + it.max_descent > it.last_visible_y)
--- 1296,1311 ----
        if (top_y < window_top_y)
        visible_p = bottom_y > window_top_y;
        else if (top_y < it.last_visible_y)
          visible_p = 1;
        if (visible_p && x)
        {
          *x = it.current_x;
          *y = max (top_y + it.max_ascent - it.ascent, window_top_y);
+         if (rtop)
+           {
+             *rtop = max (0, window_top_y - top_y);
+             *rbot = max (0, bottom_y - it.last_visible_y);
+           }
        }
      }
    else if (it.current_y + it.max_ascent + it.max_descent > it.last_visible_y)
***************
*** 1319,1324 ****
--- 1322,1332 ----
              move_it_to (&it2, charpos, -1, -1, -1, MOVE_TO_POS);
              *x = it2.current_x;
              *y = it2.current_y + it2.max_ascent - it2.ascent;
+             if (rtop)
+               {
+                 *rtop = 0;
+                 *rbot = max (0, (it2.current_y + it2.max_ascent + 
it2.max_descent) - it.last_visible_y);
+               }
            }
        }
      }




reply via email to

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