X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0a07a7d8528987ea635dbf111cf08f58c6d16090..bf7945cef10c0844a32e95695c544d829da9293a:/src/gtk1/scrolbar.cpp diff --git a/src/gtk1/scrolbar.cpp b/src/gtk1/scrolbar.cpp index a235fa0e73..a165b0c8d2 100644 --- a/src/gtk1/scrolbar.cpp +++ b/src/gtk1/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