diff options
author | Niels Martin Hansen <nielsm@indvikleren.dk> | 2019-04-23 22:55:27 +0200 |
---|---|---|
committer | Niels Martin Hansen <nielsm@indvikleren.dk> | 2019-04-24 23:04:55 +0200 |
commit | 37daf430379610536b5725fabd07847907499d41 (patch) | |
tree | 001036718ac8fdca6cd7bcb2c878df5ddcf4692b /src/main_gui.cpp | |
parent | 58609e8fa699a82b6619021119bce5e550eb6188 (diff) | |
download | openttd-37daf430379610536b5725fabd07847907499d41.tar.xz |
Change: Zoom title game by UI zoom level
Diffstat (limited to 'src/main_gui.cpp')
-rw-r--r-- | src/main_gui.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/main_gui.cpp b/src/main_gui.cpp index d4559c216..b6cf616d1 100644 --- a/src/main_gui.cpp +++ b/src/main_gui.cpp @@ -199,6 +199,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), }; |