Change: Zoom title game by UI zoom level

This commit is contained in:
Niels Martin Hansen
2019-04-23 22:55:27 +02:00
committed by Charles Pigott
parent 5965f184c2
commit e38a4e1e57
4 changed files with 15 additions and 0 deletions

View File

@@ -205,6 +205,16 @@ void ZoomInOrOutToCursorWindow(bool in, Window *w)
}
}
void FixTitleGameZoom()
{
if (_game_mode != GM_MENU) return;
ViewPort *vp = FindWindowByClass(WC_MAIN_WINDOW)->viewport;
vp->zoom = _gui_zoom;
vp->virtual_width = ScaleByZoom(vp->width, vp->zoom);
vp->virtual_height = ScaleByZoom(vp->height, vp->zoom);
}
static const struct NWidgetPart _nested_main_window_widgets[] = {
NWidget(NWID_VIEWPORT, INVALID_COLOUR, WID_M_VIEWPORT), SetResize(1, 1),
};