There is no need to compute intersections with 0-sized cells, skip them to
speed up refresh of big grids.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72292
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
wxGridCellCoordsArray wxGrid::CalcCellsExposed( const wxRegion& reg ) const
{
wxGridCellCoordsArray wxGrid::CalcCellsExposed( const wxRegion& reg ) const
{
- wxRegionIterator iter( reg );
wxRect r;
wxGridCellCoordsArray cellsExposed;
int left, top, right, bottom;
wxRect r;
wxGridCellCoordsArray cellsExposed;
int left, top, right, bottom;
+ for ( wxRegionIterator iter(reg); iter; ++iter )
+ // Skip 0-height cells, they're invisible anyhow, don't waste time
+ // getting their rectangles and so on.
+ if ( !r.GetHeight() )
+ continue;
+
// TODO: remove this when we can...
// There is a bug in wxMotif that gives garbage update
// rectangles if you jump-scroll a long way by clicking the
// TODO: remove this when we can...
// There is a bug in wxMotif that gives garbage update
// rectangles if you jump-scroll a long way by clicking the
for ( size_t n = 0; n < count; n++ )
cellsExposed.Add(wxGridCellCoords(row, cols[n]));
}
for ( size_t n = 0; n < count; n++ )
cellsExposed.Add(wxGridCellCoords(row, cols[n]));
}