X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/de6185e212ebc37ff11ff70278e3c4f68419b097..bf6c0db6243368ee239563a1151156beb5b848fa:/src/gtk1/slider.cpp diff --git a/src/gtk1/slider.cpp b/src/gtk1/slider.cpp index 6f37e77222..e0070f21ed 100644 --- a/src/gtk1/slider.cpp +++ b/src/gtk1/slider.cpp @@ -16,9 +16,9 @@ #ifndef WX_PRECOMP #include "wx/utils.h" + #include "wx/math.h" #endif -#include "wx/math.h" #include "wx/gtk1/private.h" //----------------------------------------------------------------------------- @@ -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 )