1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-23 06:44:38 +01:00

fix scrollbar scrolling

This commit is contained in:
IntelOrca
2016-01-05 23:37:57 +00:00
parent 50eaa99eac
commit 2b343838e0

View File

@@ -661,16 +661,16 @@ static void input_scroll_continue(rct_window *w, int widgetIndex, int state, int
widget_scroll_get_part(w, widget, x, y, &x2, &y2, &scroll_part, &scroll_id);
if (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_SCROLL_AREA, uint16) == SCROLL_PART_HSCROLLBAR_THUMB){
gTooltipCursorX = x - gTooltipCursorX;
input_scroll_part_update_hthumb(w, widgetIndex, x, scroll_id);
int originalTooltipCursorX = gTooltipCursorX;
gTooltipCursorX = x;
input_scroll_part_update_hthumb(w, widgetIndex, x - originalTooltipCursorX, scroll_id);
return;
}
if (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_SCROLL_AREA, uint16) == SCROLL_PART_VSCROLLBAR_THUMB){
int temp_y = y;
y -= RCT2_GLOBAL(RCT2_ADDRESS_TOOLTIP_CURSOR_Y, uint16);
RCT2_GLOBAL(RCT2_ADDRESS_TOOLTIP_CURSOR_Y, uint16) = temp_y;
input_scroll_part_update_vthumb(w, widgetIndex, y, scroll_id);
int originalTooltipCursorY = gTooltipCursorY;
gTooltipCursorY = y;
input_scroll_part_update_vthumb(w, widgetIndex, y - originalTooltipCursorY, scroll_id);
return;
}
@@ -692,10 +692,6 @@ static void input_scroll_continue(rct_window *w, int widgetIndex, int state, int
case SCROLL_PART_HSCROLLBAR_RIGHT:
input_scroll_part_update_hright(w, widgetIndex, scroll_id);
break;
case SCROLL_PART_HSCROLLBAR_LEFT_TROUGH:
case SCROLL_PART_HSCROLLBAR_RIGHT_TROUGH:
return;
break;
case SCROLL_PART_HSCROLLBAR_THUMB:
case SCROLL_PART_VSCROLLBAR_TOP:
input_scroll_part_update_vtop(w, widgetIndex, scroll_id);
@@ -703,12 +699,6 @@ static void input_scroll_continue(rct_window *w, int widgetIndex, int state, int
case SCROLL_PART_VSCROLLBAR_BOTTOM:
input_scroll_part_update_vbottom(w, widgetIndex, scroll_id);
break;
case SCROLL_PART_VSCROLLBAR_TOP_TROUGH:
case SCROLL_PART_VSCROLLBAR_BOTTOM_TROUGH:
return;
break;
default:
return;
}
}