From dd42b31ac43a08a15e5fa6e7ada37dbf8f4a05f9 Mon Sep 17 00:00:00 2001 From: Gerd Moellmann Date: Mon, 23 Jul 2001 11:33:58 +0000 Subject: [PATCH] (adjust_glyph_matrix): In the optimization for windows whose height has changed, use the new window height to compute which rows to invalidate. --- src/ChangeLog | 4 ++++ src/dispnew.c | 14 ++++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 1e6c0d1cbf2..790b79e07cd 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,9 @@ 2001-07-23 Gerd Moellmann + * dispnew.c (adjust_glyph_matrix): In the optimization for + windows whose height has changed, use the new window height + to compute which rows to invalidate. + * editfns.c (toplevel) [STDC_HEADERS]: Include float.h. (MAX_10_EXP): New macro. (Fformat): Use it. diff --git a/src/dispnew.c b/src/dispnew.c index 452bd64c12e..afef7909a80 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -797,14 +797,16 @@ adjust_glyph_matrix (w, matrix, x, y, dim) && matrix->window_top_y == XFASTINT (w->top) && matrix->window_width == window_width) { - i = 0; - while (matrix->rows[i].enabled_p - && (MATRIX_ROW_BOTTOM_Y (matrix->rows + i) - < matrix->window_height)) - ++i; + /* Find the last row in the window. */ + for (i = 0; i < matrix->nrows && matrix->rows[i].enabled_p; ++i) + if (MATRIX_ROW_BOTTOM_Y (matrix->rows + i) >= window_height) + { + ++i; + break; + } /* Window end is invalid, if inside of the rows that - are invalidated. */ + are invalidated below. */ if (INTEGERP (w->window_end_vpos) && XFASTINT (w->window_end_vpos) >= i) w->window_end_valid = Qnil; -- 2.39.5