]> git.saurik.com Git - wxWidgets.git/commitdiff
Fix bug in which splitter would not close if sash pulled to one edge
authorUnknown (BV) <nobody@localhost>
Thu, 20 May 1999 04:22:38 +0000 (04:22 +0000)
committerUnknown (BV) <nobody@localhost>
Thu, 20 May 1999 04:22:38 +0000 (04:22 +0000)
of window when minimum pane size != 0.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2518 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/splitter.cpp

index 4272fe2514cd812c90e277dd9222e2400e4df4bb..8e3eb0b62259760e78ed5b9416acc384c4fb4664 100644 (file)
@@ -756,21 +756,22 @@ void wxSplitterWindow::OnSashPosChanged(wxSplitterEvent& event)
         // threshold top / left check
         newSashPosition = 0;
     }
         // threshold top / left check
         newSashPosition = 0;
     }
-    else if ( newSashPosition >= window_size - UNSPLIT_THRESHOLD )
+    else if ( newSashPosition < m_minimumPaneSize )
+    {
+        // If resultant pane would be too small, enlarge it
+        newSashPosition = m_minimumPaneSize;
+    }
+
+    if ( newSashPosition >= window_size - UNSPLIT_THRESHOLD )
     {
         // threshold bottom/right check
         newSashPosition = window_size;
     }
     {
         // threshold bottom/right check
         newSashPosition = window_size;
     }
-
-    // If resultant pane would be too small, enlarge it.
-
-    // Check upper / left pane
-    if ( newSashPosition < m_minimumPaneSize )
-        newSashPosition = m_minimumPaneSize;
-
-    // Check lower / right pane (check even if sash was just adjusted)
-    if ( newSashPosition > window_size - m_minimumPaneSize )
+    else if ( newSashPosition > window_size - m_minimumPaneSize )
+    {
+        // If resultant pane would be too small, enlarge it
         newSashPosition = window_size - m_minimumPaneSize;
         newSashPosition = window_size - m_minimumPaneSize;
+    }
 
     // If the result is out of bounds it means minimum size is too big,
     // so split window in half as best compromise.
 
     // If the result is out of bounds it means minimum size is too big,
     // so split window in half as best compromise.