mirror of https://github.com/OpenRCT2/OpenRCT2.git
Merge pull request #1759 from medsouz/scrolloverflow
Fix scrollbar integer overflow when scrolling up or left.
This commit is contained in:
commit
4ee464fb1b
|
@ -693,9 +693,10 @@ static void input_scroll_part_update_hleft(rct_window *w, int widgetIndex, int s
|
|||
{
|
||||
if (window_find_by_number(w->classification, w->number)) {
|
||||
w->scrolls[scroll_id].flags |= HSCROLLBAR_LEFT_PRESSED;
|
||||
w->scrolls[scroll_id].h_left -= 3;
|
||||
if (w->scrolls[scroll_id].h_left < 0)
|
||||
w->scrolls[scroll_id].h_left = 0;
|
||||
else if (w->scrolls[scroll_id].h_left >= 3)
|
||||
w->scrolls[scroll_id].h_left -= 3;
|
||||
widget_scroll_update_thumbs(w, widgetIndex);
|
||||
widget_invalidate_by_number(w->classification, w->number, widgetIndex);
|
||||
}
|
||||
|
@ -733,9 +734,10 @@ static void input_scroll_part_update_vtop(rct_window *w, int widgetIndex, int sc
|
|||
{;
|
||||
if (window_find_by_number(w->classification, w->number)) {
|
||||
w->scrolls[scroll_id].flags |= VSCROLLBAR_UP_PRESSED;
|
||||
w->scrolls[scroll_id].v_top -= 3;
|
||||
if (w->scrolls[scroll_id].v_top < 0)
|
||||
w->scrolls[scroll_id].v_top = 0;
|
||||
else if (w->scrolls[scroll_id].v_top >= 3)
|
||||
w->scrolls[scroll_id].v_top -= 3;
|
||||
widget_scroll_update_thumbs(w, widgetIndex);
|
||||
widget_invalidate_by_number(w->classification, w->number, widgetIndex);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue