emacs-diffs
[Top][All Lists]
Advanced

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

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


From: Jason Rumney
Subject: [Emacs-diffs] Changes to emacs/src/w32term.c
Date: Mon, 18 Feb 2002 18:31:06 -0500

Index: emacs/src/w32term.c
diff -c emacs/src/w32term.c:1.143 emacs/src/w32term.c:1.144
*** emacs/src/w32term.c:1.143   Sun Feb 17 18:42:40 2002
--- emacs/src/w32term.c Mon Feb 18 18:31:06 2002
***************
*** 7609,7615 ****
       RECT *rect;
  {
    Lisp_Object window;
!   int part, found = 0;
  
    window = window_from_coordinates (f, x, y, &part, 0);
    if (!NILP (window))
--- 7609,7615 ----
       RECT *rect;
  {
    Lisp_Object window;
!   int part;
  
    window = window_from_coordinates (f, x, y, &part, 0);
    if (!NILP (window))
***************
*** 7619,7645 ****
        struct glyph_row *end = r + w->current_matrix->nrows - 1;
  
        frame_to_window_pixel_xy (w, &x, &y);
!       
!       for (; !found && r < end && r->enabled_p; ++r)
!       if (r->y + r->height >= y)
          {
            struct glyph *g = r->glyphs[TEXT_AREA];
            struct glyph *end = g + r->used[TEXT_AREA];
            int gx;
!             
!           for (gx = r->x; !found && g < end; gx += g->pixel_width, ++g)
!             if (gx + g->pixel_width >= x)
                {
                  rect->left = WINDOW_TO_FRAME_PIXEL_X (w, gx);
-                 rect->top = WINDOW_TO_FRAME_PIXEL_Y (w, r->y);
                  rect->right = rect->left + g->pixel_width;
!                 rect->bottom = rect->top + r->height;
!                 found = 1;
                }
          }
      }
  
!   return found;
  }
  
  /* Record the position of the mouse in last_mouse_glyph.  */
--- 7619,7662 ----
        struct glyph_row *end = r + w->current_matrix->nrows - 1;
  
        frame_to_window_pixel_xy (w, &x, &y);
! 
!       for (; r < end && r->enabled_p; ++r)
!       if (r->y <= y && r->y + r->height > y)
          {
+           /* Found the row at y.  */
            struct glyph *g = r->glyphs[TEXT_AREA];
            struct glyph *end = g + r->used[TEXT_AREA];
            int gx;
! 
!           rect->top = WINDOW_TO_FRAME_PIXEL_Y (w, r->y);
!           rect->bottom = rect->top + r->height;
! 
!           if (x < r->x)
!             {
!               /* x is to the left of the first glyph in the row.  */
!               rect->left = XINT (w->left);
!               rect->right = WINDOW_TO_FRAME_PIXEL_X (w, r->x);
!               return 1;
!             }
! 
!           for (gx = r->x; g < end; gx += g->pixel_width, ++g)
!             if (gx <= x && gx + g->pixel_width > x)
                {
+                 /* x is on a glyph.  */
                  rect->left = WINDOW_TO_FRAME_PIXEL_X (w, gx);
                  rect->right = rect->left + g->pixel_width;
!                 return 1;
                }
+ 
+           /* x is to the right of the last glyph in the row.  */
+           rect->left = WINDOW_TO_FRAME_PIXEL_X (w, gx);
+           rect->right = XINT (w->left) + XINT (w->width);
+           return 1;
          }
      }
  
!   /* The y is not on any row.  */
!   return 0;
  }
  
  /* Record the position of the mouse in last_mouse_glyph.  */



reply via email to

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