Applied patch [ 657501 ] SpinButton wraps 1 too much

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18430 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart 2002-12-27 15:21:34 +00:00
parent 16990160f6
commit 5f133dc1bb

View File

@ -144,14 +144,14 @@ int wxSpinButton::NormalizeValue(int value) const
if ( value > m_max )
{
if ( GetWindowStyleFlag() & wxSP_WRAP )
value = m_min + (value - m_max) % (m_max - m_min);
value = m_min + (value - m_max - 1) % (m_max - m_min + 1);
else
value = m_max;
}
else if ( value < m_min )
{
if ( GetWindowStyleFlag() & wxSP_WRAP )
value = m_max - (m_min - value) % (m_max - m_min);
value = m_max - (m_min - value - 1) % (m_max - m_min + 1);
else
value = m_min;
}