@@ -143,36 +143,38 @@ bool DoZoomInOutWindow(ZoomStateChange h
break;
case ZOOM_IN:
if (vp->zoom == ZOOM_LVL_MIN) return false;
vp->zoom = (ZoomLevel)((int)vp->zoom - 1);
vp->virtual_width >>= 1;
vp->virtual_height >>= 1;
w->viewport->scrollpos_x += vp->virtual_width >> 1;
w->viewport->scrollpos_y += vp->virtual_height >> 1;
w->viewport->dest_scrollpos_x = w->viewport->scrollpos_x;
w->viewport->dest_scrollpos_y = w->viewport->scrollpos_y;
w->viewport->follow_vehicle = INVALID_VEHICLE;
case ZOOM_OUT:
if (vp->zoom == ZOOM_LVL_MAX) return false;
vp->zoom = (ZoomLevel)((int)vp->zoom + 1);
w->viewport->scrollpos_x -= vp->virtual_width >> 1;
w->viewport->scrollpos_y -= vp->virtual_height >> 1;
vp->virtual_width <<= 1;
vp->virtual_height <<= 1;
}
if (vp != NULL) { // the vp can be null when how == ZOOM_NONE
vp->virtual_left = w->viewport->scrollpos_x;
vp->virtual_top = w->viewport->scrollpos_y;
/* Update the windows that have zoom-buttons to perhaps disable their buttons */
w->InvalidateData();
return true;
void ZoomInOrOutToCursorWindow(bool in, Window *w)
Status change: