diff --git a/Game/Behaviours/CameraController.cs b/Game/Behaviours/CameraController.cs index 242f310..3d3a8d3 100644 --- a/Game/Behaviours/CameraController.cs +++ b/Game/Behaviours/CameraController.cs @@ -50,8 +50,8 @@ public class CameraController : BehaviourOverride Game1.graphics.IsFullScreen = true; Game1.graphics.ApplyChanges(); - float previousScreenSize = Math.Sqrt(Math.Pow(cameraBehaviour.Viewport.Width, 2f) + Math.Pow(cameraBehaviour.Viewport.Height, 2f)); - float currentScreenSize = Math.Sqrt(Math.Pow(Game1.graphics.GraphicsDevice.Viewport.Width, 2f) + Math.Pow(Game1.graphics.GraphicsDevice.Viewport.Height, 2f)); + float previousScreenSize = Math.Sqrt(Math.Sqr(cameraBehaviour.Viewport.Width) + Math.Sqr(cameraBehaviour.Viewport.Height)); + float currentScreenSize = Math.Sqrt(Math.Sqr(Game1.graphics.GraphicsDevice.Viewport.Width) + Math.Sqr(Game1.graphics.GraphicsDevice.Viewport.Height)); defaultZoomLevel /= previousScreenSize / currentScreenSize; cameraBehaviour.Zoom /= previousScreenSize / currentScreenSize; cameraBehaviour.Viewport = Game1.graphics.GraphicsDevice.Viewport;