|
|
|
@ -1466,6 +1466,12 @@ static bool HandleViewportScroll()
|
|
|
|
|
|
|
|
|
|
w = FindWindowFromPt(_cursor.pos.x, _cursor.pos.y);
|
|
|
|
|
|
|
|
|
|
if (!(_right_button_down || scrollwheel_scrolling) || w == NULL) {
|
|
|
|
|
_cursor.fix_at = false;
|
|
|
|
|
_scrolling_viewport = false;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (WP(w, vp_d).follow_vehicle != INVALID_VEHICLE && w == FindWindowById(WC_MAIN_WINDOW, 0)) {
|
|
|
|
|
/* If the main window is following a vehicle, then first let go of it! */
|
|
|
|
|
const Vehicle *veh = GetVehicle(WP(w, vp_d).follow_vehicle);
|
|
|
|
@ -1473,12 +1479,6 @@ static bool HandleViewportScroll()
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!(_right_button_down || scrollwheel_scrolling) || w == NULL) {
|
|
|
|
|
_cursor.fix_at = false;
|
|
|
|
|
_scrolling_viewport = false;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (_patches.reverse_scroll) {
|
|
|
|
|
e.we.scroll.delta.x = -_cursor.delta.x;
|
|
|
|
|
e.we.scroll.delta.y = -_cursor.delta.y;
|
|
|
|
|