From: Kim F. Storm Date: Sun, 23 Jan 2005 00:50:52 +0000 (+0000) Subject: (pos_visible_p): Fix calculation of y. X-Git-Tag: ttn-vms-21-2-B4~2618 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=78465f3a8c37972ebff48b6c961196472fceef16;p=emacs.git (pos_visible_p): Fix calculation of y. Clear last_height before calling line_bottom_y to get real height. --- diff --git a/src/xdisp.c b/src/xdisp.c index 17ee38f6fc0..f1877c494cb 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -1292,7 +1292,7 @@ pos_visible_p (w, charpos, x, y, rtop, rbot, exact_mode_line_heights_p) if (IT_CHARPOS (it) >= charpos) { int top_y = it.current_y; - int bottom_y = line_bottom_y (&it); + int bottom_y = (last_height = 0, line_bottom_y (&it)); int window_top_y = WINDOW_HEADER_LINE_HEIGHT (w); if (top_y < window_top_y) @@ -1302,7 +1302,7 @@ pos_visible_p (w, charpos, x, y, rtop, rbot, exact_mode_line_heights_p) if (visible_p && x) { *x = it.current_x; - *y = max (top_y + it.max_ascent - it.ascent, window_top_y); + *y = max (top_y + max (0, it.max_ascent - it.ascent), window_top_y); if (rtop) { *rtop = max (0, window_top_y - top_y);