X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f48a115976827701bb7b4bab7333f7512de08ab2..3013861102292eb82391e361bee1dc090783c653:/src/generic/grid.cpp

diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp
index d60b2c579d..d9a1a800d4 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);
 
@@ -6281,7 +6281,9 @@ int wxGrid::PosToEdgeOfLine(int pos, const wxGridOperations& oper) const
         else if ( line > 0 &&
                     pos - oper.GetLineStartPos(this,
                                                line) < WXGRID_LABEL_EDGE_ZONE )
-            return line - 1;
+        {
+            return oper.GetLineBefore(this, line);
+        }
     }
 
     return -1;