X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f00acdb8f4e91830a8b211518fd179369128f504..9ed3454e3d06f99510cd203419c40c46a0370c08:/src/generic/grid.cpp?ds=sidebyside diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index f96b05a75d..d4d7a12b40 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -72,7 +72,7 @@ const char wxGridNameStr[] = "grid"; // Required for wxIs... functions #include -WX_DECLARE_HASH_SET_WITH_DECL_PTR(int, ::wxIntegerHash, ::wxIntegerEqual, +WX_DECLARE_HASH_SET_WITH_DECL_PTR(int, wxIntegerHash, wxIntegerEqual, wxGridFixedIndicesSet, class WXDLLIMPEXP_ADV); @@ -1942,20 +1942,20 @@ wxGrid::SetRenderScale(wxDC& dc, double scaleX, scaleY; wxSize sizeTemp; - if ( size.GetX() != wxDefaultSize.GetX() ) // size.x was specified - sizeTemp.SetWidth( size.GetX() ); + if ( size.GetWidth() != wxDefaultSize.GetWidth() ) // size.x was specified + sizeTemp.SetWidth( size.GetWidth() ); else - sizeTemp.SetWidth( dc.DeviceToLogicalXRel( dc.GetSize().GetX() ) + sizeTemp.SetWidth( dc.DeviceToLogicalXRel( dc.GetSize().GetWidth() ) - pos.x ); - if ( size.GetY() != wxDefaultSize.GetY() ) // size.y was specified - sizeTemp.SetHeight( size.GetY() ); + if ( size.GetHeight() != wxDefaultSize.GetHeight() ) // size.y was specified + sizeTemp.SetHeight( size.GetHeight() ); else - sizeTemp.SetHeight( dc.DeviceToLogicalYRel( dc.GetSize().GetY() ) + sizeTemp.SetHeight( dc.DeviceToLogicalYRel( dc.GetSize().GetHeight() ) - pos.y ); - scaleX = (double)( (double) sizeTemp.GetX() / (double) sizeGrid.GetX() ); - scaleY = (double)( (double) sizeTemp.GetY() / (double) sizeGrid.GetY() ); + scaleX = (double)( (double) sizeTemp.GetWidth() / (double) sizeGrid.GetWidth() ); + scaleY = (double)( (double) sizeTemp.GetHeight() / (double) sizeGrid.GetHeight() ); dc.SetUserScale( wxMin( scaleX, scaleY), wxMin( scaleX, scaleY ) ); } @@ -3167,16 +3167,20 @@ wxArrayInt wxGrid::CalcColLabelsExposed( const wxRegion& reg ) const wxGridCellCoordsArray wxGrid::CalcCellsExposed( const wxRegion& reg ) const { - wxRegionIterator iter( reg ); wxRect r; wxGridCellCoordsArray cellsExposed; int left, top, right, bottom; - while ( iter ) + for ( wxRegionIterator iter(reg); iter; ++iter ) { r = iter.GetRect(); + // 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 @@ -3224,8 +3228,6 @@ wxGridCellCoordsArray wxGrid::CalcCellsExposed( const wxRegion& reg ) const for ( size_t n = 0; n < count; n++ ) cellsExposed.Add(wxGridCellCoords(row, cols[n])); } - - ++iter; } return cellsExposed;