X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0a07a7d8528987ea635dbf111cf08f58c6d16090..1c7e7d5b1e9085e6afcfac8e914a2cdeb3bc405c:/src/gtk/slider.cpp diff --git a/src/gtk/slider.cpp b/src/gtk/slider.cpp index 6ad996cbfc..00a061af9e 100644 --- a/src/gtk/slider.cpp +++ b/src/gtk/slider.cpp @@ -62,7 +62,7 @@ static void gtk_slider_callback( GtkAdjustment *adjust, wxSlider *win ) else if (range->scroll_type == GTK_SCROLL_PAGE_FORWARD) command = wxEVT_SCROLL_PAGEDOWN; double dvalue = adjust->value; - int value = (int)(dvalue >= 0 ? dvalue - 0.5 : dvalue + 0.5); + int value = (int)(dvalue < 0 ? dvalue - 0.5 : dvalue + 0.5); int orient = wxHORIZONTAL; if ( (win->GetWindowStyleFlag() & wxSB_VERTICAL) == wxSB_VERTICAL) @@ -161,7 +161,7 @@ int wxSlider::GetValue() const // 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); + return (int)(val < 0 ? val - 0.5 : val + 0.5); } void wxSlider::SetValue( int value )