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
This commit is contained in:
Unknown (BV) 1999-05-20 04:22:38 +00:00
parent 98216d409f
commit bc79aa6b22

View File

@ -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.