changeset 38528:c867615c6a26

(adjust_glyph_matrix): In the optimization for windows whose height has changed, use the new window height to compute which rows to invalidate.
author Gerd Moellmann <gerd@gnu.org>
date Mon, 23 Jul 2001 11:33:42 +0000
parents 71c6489a2aff
children 0e8aa50a6ac0
files src/dispnew.c
diffstat 1 files changed, 8 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/dispnew.c	Mon Jul 23 10:08:53 2001 +0000
+++ b/src/dispnew.c	Mon Jul 23 11:33:42 2001 +0000
@@ -797,14 +797,16 @@
 	      && 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;