From b2e7f290f21372a1664e166f42be86a29d3bffa8 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 20 Sep 2016 16:26:07 +0900 Subject: [PATCH] Fix window size. --- osu.Game/OsuGame.cs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 315150a2cd..b1aeaa0a2d 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -13,6 +13,7 @@ using osu.Framework.Graphics.Cursor; using osu.Framework.Graphics.Textures; using osu.Framework.IO.Stores; +using osu.Framework.OS; namespace osu.Game { @@ -24,6 +25,13 @@ public class OsuGame : Framework.Game internal APIAccess API; + public override void SetHost(BasicGameHost host) + { + base.SetHost(host); + + host.Size = new Vector2(Config.Get(OsuConfig.Width), Config.Get(OsuConfig.Height)); + } + public override void Load() { base.Load(); @@ -31,8 +39,6 @@ public override void Load() //this completely overrides the framework default. will need to change once we make a proper FontStore. Fonts = new TextureStore(new GlyphStore(Resources, @"Fonts/Exo2.0-Regular")) { ScaleAdjust = 0.01f }; - Parent.Size = new Vector2(Config.Get(OsuConfig.Width), Config.Get(OsuConfig.Height)); - API = new APIAccess() { Username = Config.Get(OsuConfig.Username), @@ -73,8 +79,8 @@ public override bool Invalidate(Invalidation invalidation = Invalidation.All, Dr if (Parent != null) { - Parent.Width = Config.Set(OsuConfig.Width, ActualSize.X).Value; - Parent.Height = Config.Set(OsuConfig.Height, ActualSize.Y).Value; + Config.Set(OsuConfig.Width, ActualSize.X); + Config.Set(OsuConfig.Height, ActualSize.Y); } return true; }