wxRound() workaround to avoid unexpected compile and link errors on incomplete environments (Tinderbox build fix).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40024 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2006-07-06 09:09:09 +00:00
parent 2ea6c1f77a
commit 23f826bdf9
4 changed files with 48 additions and 39 deletions

View File

@@ -44,13 +44,6 @@ static inline bool AreSameAdjustValues(double x, double y)
return fabs(x - y) < 0.02;
}
static inline int AdjustValueToInt(double x)
{
// we want to round to the nearest integer, i.e. 0.9 is rounded to 1 and
// -0.9 is rounded to -1
return (int)(x < 0 ? x - 0.5 : x + 0.5);
}
// process a scroll event
static void
ProcessScrollEvent(wxSlider *win, wxEventType evtType, double dvalue)
@@ -209,7 +202,7 @@ bool wxSlider::Create(wxWindow *parent, wxWindowID id,
int wxSlider::GetValue() const
{
return AdjustValueToInt(m_adjust->value);
return wxRound(m_adjust->value);
}
void wxSlider::SetValue( int value )