Fix scaling

This commit is contained in:
Stone_Red
2023-10-12 17:25:31 +02:00
parent 9966986d5e
commit 9ce469a403
+3 -2
View File
@@ -20,7 +20,6 @@ namespace StoneRed.LogicSimulator;
internal class Srls : Game internal class Srls : Game
{ {
public const ushort CurrentSaveVersion = 1;
private readonly ScreenManager screenManager; private readonly ScreenManager screenManager;
private SrlsWindow? currentSrlsWindow = null; private SrlsWindow? currentSrlsWindow = null;
private SrlsScreen? currentSrlsScreen = null; private SrlsScreen? currentSrlsScreen = null;
@@ -38,6 +37,8 @@ internal class Srls : Game
public Settings Settings { get; set; } public Settings Settings { get; set; }
public const ushort CurrentSaveVersion = 1;
public Srls() public Srls()
{ {
Content.RootDirectory = "Content"; Content.RootDirectory = "Content";
@@ -120,7 +121,7 @@ internal class Srls : Game
protected override void Update(GameTime gameTime) protected override void Update(GameTime gameTime)
{ {
Scale = 1f / 800 * Window.ClientBounds.Height * Settings.Scale; Scale = 1f / 800 * Window.ClientBounds.Width * Settings.Scale;
Desktop.Root.Scale = currentSrlsScreen?.ScalingEnabled == true ? new Vector2(Scale, Scale) : Vector2.One; Desktop.Root.Scale = currentSrlsScreen?.ScalingEnabled == true ? new Vector2(Scale, Scale) : Vector2.One;
if (Desktop.ContextMenu is not null) if (Desktop.ContextMenu is not null)