From: Unknown (BV) Date: Thu, 20 May 1999 04:22:38 +0000 (+0000) Subject: Fix bug in which splitter would not close if sash pulled to one edge X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/bc79aa6b22e268eae7796acea8f2b21a20e8f836?ds=inline Fix bug in which splitter would not close if sash pulled to one edge of window when minimum pane size != 0. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2518 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/generic/splitter.cpp b/src/generic/splitter.cpp index 4272fe2514..8e3eb0b622 100644 --- a/src/generic/splitter.cpp +++ b/src/generic/splitter.cpp @@ -756,21 +756,22 @@ void wxSplitterWindow::OnSashPosChanged(wxSplitterEvent& event) // 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; } - - // 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; + } // If the result is out of bounds it means minimum size is too big, // so split window in half as best compromise.