Sheet View optimisation: Do not attempt to draw sheet cells which lie outside of...
authorJohn Darrington <john@darrington.wattle.id.au>
Thu, 14 May 2015 17:01:24 +0000 (19:01 +0200)
committerJohn Darrington <john@darrington.wattle.id.au>
Thu, 14 May 2015 17:01:24 +0000 (19:01 +0200)
src/ui/gui/pspp-sheet-view.c

index 7c80ec0c0284938e0d356d283a01e43e395b780e..cbc14efd926e1cfd8c11e0499988acb19645368b 100644 (file)
@@ -3894,6 +3894,9 @@ pspp_sheet_view_bin_expose (GtkWidget      *widget,
   GtkAllocation allocation;
   gtk_widget_get_allocation (widget, &allocation);
 
+  GdkRectangle exposed_rect;
+  gdk_cairo_get_clip_rectangle (cr, &exposed_rect);
+  
   Zarea.x =      0;
   Zarea.y =      0;
   Zarea.height = allocation.height;
@@ -4131,11 +4134,14 @@ pspp_sheet_view_bin_expose (GtkWidget      *widget,
 
 #if GTK3_TRANSITION
          if (gdk_region_rect_in (event->region, &background_area) == GDK_OVERLAP_RECTANGLE_OUT)
+#else
+         if (!gdk_rectangle_intersect (&background_area, &exposed_rect, NULL))
+#endif
            {
              cell_offset += column->width;
              continue;
            }
-#endif
+
 
          pspp_sheet_view_column_cell_set_cell_data (column,
                                                      tree_view->priv->model,