1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-27 08:45:00 +01:00

Fix small issues with scrolling.

I've found the cause of the cursors not correctly changing. It would appear ebx is popped to its previous value as the call function returns. This causes the cursor value to never change. This can be solved when all windows are complete. Fixes points i, ii, iii, iv of #1127 (Fixed by reseting scroll positions when the height is 0. And actually passing the scroll index to the calling function)
This commit is contained in:
Duncan Frost
2015-06-03 20:54:28 +01:00
parent 21b57e90a3
commit c9543005de
3 changed files with 17 additions and 4 deletions

View File

@@ -845,6 +845,12 @@ void window_update_scroll_widgets(rct_window *w)
scroll = &w->scrolls[scrollIndex];
window_get_scroll_size(w, scrollIndex, &width, &height);
if (height == 0){
scroll->v_top = 0;
}
else if (width == 0){
scroll->h_left = 0;
}
width++;
height++;
@@ -872,7 +878,7 @@ int window_get_scroll_size(rct_window *w, int scrollIndex, int *width, int *heig
rct_widget *widget = window_get_scroll_widget(w, scrollIndex);
int widgetIndex = window_get_widget_index(w, widget);
int eax = 0, ebx = scrollIndex * sizeof(rct_scroll), ecx = 0, edx = 0, esi = (int)w, edi = widgetIndex * sizeof(rct_widget), ebp = 0;
int eax = scrollIndex, ebx = scrollIndex * sizeof(rct_scroll), ecx = 0, edx = 0, esi = (int)w, edi = widgetIndex * sizeof(rct_widget), ebp = 0;
RCT2_CALLFUNC_X(w->event_handlers[WE_SCROLL_GETSIZE], & eax, &ebx, &ecx, &edx, &esi, &edi, &ebp);
*width = ecx;
*height = edx;