(glyph_rect): Return 0 if position is outside text area.

This commit is contained in:
Kim F. Storm 2005-10-10 22:54:19 +00:00
parent 31ab1f0585
commit f0ad2f4c89

View file

@ -3647,8 +3647,9 @@ glyph_rect (f, x, y, rect)
Lisp_Object window;
struct window *w;
struct glyph_row *r, *end_row;
enum window_part part;
window = window_from_coordinates (f, x, y, 0, &x, &y, 0);
window = window_from_coordinates (f, x, y, &part, &x, &y, 0);
if (NILP (window))
return 0;
@ -3656,6 +3657,9 @@ glyph_rect (f, x, y, rect)
r = MATRIX_FIRST_TEXT_ROW (w->current_matrix);
end_row = r + w->current_matrix->nrows - 1;
if (part != ON_TEXT)
return 0;
for (; r < end_row && r->enabled_p; ++r)
{
if (r->y >= y)