minSize = m_minimumPaneSize;
int maxSize = GetWindowSize() - minSize - GetBorderSize() - GetSashSize();
- if ( maxSize > 0 && sashPos > maxSize )
+ if ( maxSize > 0 && sashPos > maxSize && maxSize >= m_minimumPaneSize)
sashPos = maxSize;
}
pSash = &sizeBest.y;
}
- // account for the border and the sash
+ // account for the sash if the window is actually split
+ if ( m_windowOne && m_windowTwo )
+ *pSash += GetSashSize();
+
+ // account for the border too
int border = 2*GetBorderSize();
- *pSash += GetSashSize();
sizeBest.x += border;
sizeBest.y += border;