Index: vte.c
===================================================================
RCS file: /cvs/gnome/vte/src/vte.c,v
retrieving revision 1.404
diff -u -r1.404 vte.c
--- a/vte.c     2 May 2004 06:43:01 -0000       1.404
+++ b/vte.c     21 May 2004 23:44:58 -0000
@@ -13754,10 +13754,11 @@
        char *preedit;
        int preedit_cursor;
        long width, height, ascent, descent, delta, cursor_width;
-       int i, len, fore, back, x, y;
+       int i, len, fore, back, x, y, row_count;
        GdkRectangle all_area;
        gboolean blink, selected;
  
+
 #ifdef VTE_DEBUG
        if (_vte_debug_on(VTE_DEBUG_LIFECYCLE)) {
                fprintf(stderr, "vte_terminal_paint()\n");
@@ -13780,6 +13781,10 @@
        descent = terminal->char_descent;
        delta = screen->scroll_delta;
  
+    /* row_count is now the number of complete and partial rows displayed */
+    row_count = (widget->allocation.height - 2*VTE_PAD_WIDTH + height/2) / height;
+
+
        /* Calculate the bounding rectangle. */
        if (_vte_draw_requires_repaint(terminal->pvt->draw)) {
                all_area.x = 0;
@@ -13793,7 +13798,8 @@
        row = MAX(0, (area->y - VTE_PAD_WIDTH) / height);
        row_stop = MIN(howmany((area->y - VTE_PAD_WIDTH) + area->height,
                               height),
-                      terminal->row_count - 1);
+                      row_count - 1 );
+
        col = MAX(0, (area->x - VTE_PAD_WIDTH) / width);
        col_stop = MIN(howmany((area->x - VTE_PAD_WIDTH) + area->width,
                               width),
