diff src/dispnew.c @ 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 19cb32759a2a
children 42e75caf68ff
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;