From 5353ac3f85bada2ea39ad06dd0f224058311a23a Mon Sep 17 00:00:00 2001 From: John Darrington Date: Thu, 14 May 2015 19:01:24 +0200 Subject: [PATCH] Sheet View optimisation: Do not attempt to draw sheet cells which lie outside of the exposed area. --- src/ui/gui/pspp-sheet-view.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/ui/gui/pspp-sheet-view.c b/src/ui/gui/pspp-sheet-view.c index 7c80ec0c02..cbc14efd92 100644 --- a/src/ui/gui/pspp-sheet-view.c +++ b/src/ui/gui/pspp-sheet-view.c @@ -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, -- 2.30.2