X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ef7a25a73ef4215454d6d8e3bad63bdf5b4339a0..83f96286bb4ef34147d7f467a0f0a4a4fc27af2d:/src/gtk1/slider.cpp diff --git a/src/gtk1/slider.cpp b/src/gtk1/slider.cpp index 58aa39db81..6ad996cbfc 100644 --- a/src/gtk1/slider.cpp +++ b/src/gtk1/slider.cpp @@ -61,7 +61,8 @@ static void gtk_slider_callback( GtkAdjustment *adjust, wxSlider *win ) else if (range->scroll_type == GTK_SCROLL_PAGE_BACKWARD) command = wxEVT_SCROLL_PAGEUP; else if (range->scroll_type == GTK_SCROLL_PAGE_FORWARD) command = wxEVT_SCROLL_PAGEDOWN; - int value = (int)ceil(adjust->value); + double dvalue = adjust->value; + int value = (int)(dvalue >= 0 ? dvalue - 0.5 : dvalue + 0.5); int orient = wxHORIZONTAL; if ( (win->GetWindowStyleFlag() & wxSB_VERTICAL) == wxSB_VERTICAL)