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
This commit is contained in:
@@ -4859,6 +4859,9 @@ void
|
|||||||
wxGrid::UpdateBlockBeingSelected(int topRow, int leftCol,
|
wxGrid::UpdateBlockBeingSelected(int topRow, int leftCol,
|
||||||
int bottomRow, int rightCol)
|
int bottomRow, int rightCol)
|
||||||
{
|
{
|
||||||
|
MakeCellVisible(m_selectedBlockCorner);
|
||||||
|
m_selectedBlockCorner = wxGridCellCoords(bottomRow, rightCol);
|
||||||
|
|
||||||
if ( m_selection )
|
if ( m_selection )
|
||||||
{
|
{
|
||||||
switch ( m_selection->GetSelectionMode() )
|
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(topRow, bottomRow);
|
||||||
EnsureFirstLessThanSecond(leftCol, rightCol);
|
EnsureFirstLessThanSecond(leftCol, rightCol);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user