From: Vadim Zeitlin Date: Wed, 25 Feb 2009 13:07:36 +0000 (+0000) Subject: don't call Refresh(empty-rect) unnecessarily X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/efc49a216c2b3356ef7f96716a564f1457b79546?ds=inline don't call Refresh(empty-rect) unnecessarily git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59128 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index 3a17dd5925..13014fdb15 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -6191,13 +6191,13 @@ wxRect wxGrid::CellToRect( int row, int col ) const rect.width += GetColWidth(i); for (i=row; i < row + cell_rows; i++) rect.height += GetRowHeight(i); - } - // if grid lines are enabled, then the area of the cell is a bit smaller - if (m_gridLinesEnabled) - { - rect.width -= 1; - rect.height -= 1; + // if grid lines are enabled, then the area of the cell is a bit smaller + if (m_gridLinesEnabled) + { + rect.width -= 1; + rect.height -= 1; + } } return rect; @@ -8201,8 +8201,10 @@ void wxGrid::ClearSelection() m_selectedBlockBottomRight = m_selectedBlockCorner = wxGridNoCellCoords; - Refresh( false, &r1 ); - Refresh( false, &r2 ); + if ( !r1.IsEmpty() ) + RefreshRect(r1, false); + if ( !r2.IsEmpty() ) + RefreshRect(r2, false); if ( m_selection ) m_selection->ClearSelection();