X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0a07a7d8528987ea635dbf111cf08f58c6d16090..87df17a11b0017d31c09f767bd921abb27193bee:/src/gtk/scrolbar.cpp diff --git a/src/gtk/scrolbar.cpp b/src/gtk/scrolbar.cpp index a235fa0e73..a165b0c8d2 100644 --- a/src/gtk/scrolbar.cpp +++ b/src/gtk/scrolbar.cpp @@ -64,7 +64,7 @@ static void gtk_scrollbar_callback( GtkAdjustment *adjust, wxScrollBar *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 = win->HasFlag(wxSB_VERTICAL) ? wxVERTICAL : wxHORIZONTAL; @@ -186,7 +186,7 @@ bool wxScrollBar::Create(wxWindow *parent, wxWindowID id, int wxScrollBar::GetThumbPosition() const { 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); } int wxScrollBar::GetThumbSize() const