merged in fix for GetValue() from the 2.2 branch
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8923 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -157,7 +157,10 @@ bool wxSlider::Create(wxWindow *parent, wxWindowID id,
|
|||||||
|
|
||||||
int wxSlider::GetValue() const
|
int wxSlider::GetValue() const
|
||||||
{
|
{
|
||||||
return (int)(m_adjust->value+0.5);
|
// we want to round to the nearest integer, i.e. 0.9 is rounded to 1 and
|
||||||
|
// -0.9 is rounded to -1
|
||||||
|
double val = m_adjust->value;
|
||||||
|
return (int)(val >= 0 ? val - 0.5 : val + 0.5);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxSlider::SetValue( int value )
|
void wxSlider::SetValue( int value )
|
||||||
|
@@ -157,7 +157,10 @@ bool wxSlider::Create(wxWindow *parent, wxWindowID id,
|
|||||||
|
|
||||||
int wxSlider::GetValue() const
|
int wxSlider::GetValue() const
|
||||||
{
|
{
|
||||||
return (int)(m_adjust->value+0.5);
|
// we want to round to the nearest integer, i.e. 0.9 is rounded to 1 and
|
||||||
|
// -0.9 is rounded to -1
|
||||||
|
double val = m_adjust->value;
|
||||||
|
return (int)(val >= 0 ? val - 0.5 : val + 0.5);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxSlider::SetValue( int value )
|
void wxSlider::SetValue( int value )
|
||||||
|
Reference in New Issue
Block a user