/[emacs]/emacs/src/w32term.c
ViewVC logotype

Diff of /emacs/src/w32term.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.109.4.13 by jasonr, Mon Feb 11 22:05:22 2002 UTC revision 1.109.4.14 by jasonr, Mon Feb 18 23:52:03 2002 UTC
# Line 7511  glyph_rect (f, x, y, rect) Line 7511  glyph_rect (f, x, y, rect)
7511       RECT *rect;       RECT *rect;
7512  {  {
7513    Lisp_Object window;    Lisp_Object window;
7514    int part, found = 0;    int part;
7515    
7516    
7517    window = window_from_coordinates (f, x, y, &part, 0);    window = window_from_coordinates (f, x, y, &part, 0);
7518    if (!NILP (window))    if (!NILP (window))
# Line 7519  glyph_rect (f, x, y, rect) Line 7520  glyph_rect (f, x, y, rect)
7520        struct window *w = XWINDOW (window);        struct window *w = XWINDOW (window);
7521        struct glyph_row *r = MATRIX_FIRST_TEXT_ROW (w->current_matrix);        struct glyph_row *r = MATRIX_FIRST_TEXT_ROW (w->current_matrix);
7522        struct glyph_row *end = r + w->current_matrix->nrows - 1;        struct glyph_row *end = r + w->current_matrix->nrows - 1;
       int area;  
7523    
7524        frame_to_window_pixel_xy (w, &x, &y);        frame_to_window_pixel_xy (w, &x, &y);
7525          
7526        for (; !found && r < end && r->enabled_p; ++r)        for (; r < end && r->enabled_p; ++r)
7527          if (r->y + r->height >= y)          if (r->y <= y && r->y + r->height > y)
7528            {            {
7529                /* Found the row at y.  */
7530              struct glyph *g = r->glyphs[TEXT_AREA];              struct glyph *g = r->glyphs[TEXT_AREA];
7531              struct glyph *end = g + r->used[TEXT_AREA];              struct glyph *end = g + r->used[TEXT_AREA];
7532              int gx;              int gx;
7533                  
7534              for (gx = r->x; !found && g < end; gx += g->pixel_width, ++g)              rect->top = WINDOW_TO_FRAME_PIXEL_Y (w, r->y);
7535                if (gx + g->pixel_width >= x)              rect->bottom = rect->top + r->height;
7536    
7537                if (x < r->x)
7538                  {
7539                    /* x is to the left of the first glyph in the row.  */
7540                    rect->left = XINT (w->left);
7541                    rect->right = WINDOW_TO_FRAME_PIXEL_X (w, r->x);
7542                    return 1;
7543                  }
7544    
7545                for (gx = r->x; g < end; gx += g->pixel_width, ++g)
7546                  if (gx <= x && gx + g->pixel_width > x)
7547                  {                  {
7548                      /* x is on a glyph.  */
7549                    rect->left = WINDOW_TO_FRAME_PIXEL_X (w, gx);                    rect->left = WINDOW_TO_FRAME_PIXEL_X (w, gx);
                   rect->top = WINDOW_TO_FRAME_PIXEL_Y (w, r->y);  
7550                    rect->right = rect->left + g->pixel_width;                    rect->right = rect->left + g->pixel_width;
7551                    rect->bottom = rect->top + r->height;                    return 1;
                   found = 1;  
7552                  }                  }
7553    
7554                /* x is to the right of the last glyph in the row.  */
7555                rect->left = WINDOW_TO_FRAME_PIXEL_X (w, gx);
7556                rect->right = XINT (w->left) + XINT (w->width);
7557                return 1;
7558            }            }
7559      }      }
7560    
7561    return found;    /* The y is not on any row.  */
7562      return 0;
7563  }  }
7564    
7565  /* Record the position of the mouse in last_mouse_glyph.  */  /* Record the position of the mouse in last_mouse_glyph.  */

Legend:
Removed from v.1.109.4.13  
changed lines
  Added in v.1.109.4.14

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26