From: Vadim Zeitlin Date: Tue, 2 Nov 2010 11:57:14 +0000 (+0000) Subject: Don't scroll the grid too much to bring selection in view. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/4445d0357bc7ffe2d83c5209410f2a00c5b0bb25?ds=inline Don't scroll the grid too much to bring selection in view. wxGrid scrolled completely to the right in row selection mode as it was always trying to make the bottom right selection corner visible. This was due to adjusting the selection block corner to cover the entire row in this mode (of course, the same was true for the column selection mode too). Don't do this any more as it's unnecessary, making the real selection block corner visible is enough for the block selection mode and nothing else is needed in row/column modes. See #12638. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65991 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index d60b2c579d..1b23c55dac 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -4859,6 +4859,9 @@ void wxGrid::UpdateBlockBeingSelected(int topRow, int leftCol, int bottomRow, int rightCol) { + MakeCellVisible(m_selectedBlockCorner); + m_selectedBlockCorner = wxGridCellCoords(bottomRow, rightCol); + if ( m_selection ) { switch ( m_selection->GetSelectionMode() ) @@ -4895,9 +4898,6 @@ wxGrid::UpdateBlockBeingSelected(int topRow, int leftCol, } } - m_selectedBlockCorner = wxGridCellCoords(bottomRow, rightCol); - MakeCellVisible(m_selectedBlockCorner); - EnsureFirstLessThanSecond(topRow, bottomRow); EnsureFirstLessThanSecond(leftCol, rightCol);