]> git.eshelyaron.com Git - emacs.git/commitdiff
(shift_glyph_matrix, blank_row): Fix computation
authorGerd Moellmann <gerd@gnu.org>
Fri, 27 Jul 2001 15:28:46 +0000 (15:28 +0000)
committerGerd Moellmann <gerd@gnu.org>
Fri, 27 Jul 2001 15:28:46 +0000 (15:28 +0000)
of row's visible height.

src/dispnew.c

index afef7909a809e7c0460463e791b4033907c8f699..5e16897b93ffcef15b8508ce3d60c08e72c5aaed 100644 (file)
@@ -994,13 +994,12 @@ shift_glyph_matrix (w, matrix, start, end, dy)
       struct glyph_row *row = &matrix->rows[start];
       
       row->y += dy;
+      row->visible_height = row->height;
       
       if (row->y < min_y)
-       row->visible_height = row->height - (min_y - row->y);
-      else if (row->y + row->height > max_y)
-       row->visible_height = row->height - (row->y + row->height - max_y);
-      else
-       row->visible_height = row->height;
+       row->visible_height -= min_y - row->y;
+      if (row->y + row->height > max_y)
+       row->visible_height -= row->y + row->height - max_y;
     }
 }
 
@@ -1154,13 +1153,12 @@ blank_row (w, row, y)
   row->y = y;
   row->ascent = row->phys_ascent = 0;
   row->height = row->phys_height = CANON_Y_UNIT (XFRAME (w->frame));
-  
+  row->visible_height = row->height;
+      
   if (row->y < min_y)
-    row->visible_height = row->height - (min_y - row->y);
-  else if (row->y + row->height > max_y)
-    row->visible_height = row->height - (row->y + row->height - max_y);
-  else
-    row->visible_height = row->height;
+    row->visible_height -= min_y - row->y;
+  if (row->y + row->height > max_y)
+    row->visible_height -= row->y + row->height - max_y;
 
   row->enabled_p = 1;
 }