fix: label positions and sizes

This commit is contained in:
2026-03-28 23:35:15 +03:00
parent 5cb259dba1
commit eb8bf5837c
4 changed files with 39 additions and 14 deletions

View File

@@ -53,11 +53,11 @@ public class CameraController : Behaviour, IFirstFrameUpdate, IUpdate
cameraBehaviour.Graphics.IsFullScreen = true;
cameraBehaviour.Graphics.ApplyChanges();
float previousScreenSize = Math.Sqrt(Math.Sqr(cameraBehaviour.Viewport.Width) + Math.Sqr(cameraBehaviour.Viewport.Height));
float previousScreenSize = Math.Sqrt(Math.Sqr(cameraBehaviour.Viewport.X) + Math.Sqr(cameraBehaviour.Viewport.Y));
float currentScreenSize = Math.Sqrt(Math.Sqr(cameraBehaviour.Graphics.GraphicsDevice.Viewport.Width) + Math.Sqr(cameraBehaviour.Graphics.GraphicsDevice.Viewport.Height));
defaultZoomLevel /= previousScreenSize / currentScreenSize;
cameraBehaviour.Zoom /= previousScreenSize / currentScreenSize;
cameraBehaviour.Viewport = cameraBehaviour.Graphics.GraphicsDevice.Viewport;
cameraBehaviour.Viewport = new(cameraBehaviour.Graphics.GraphicsDevice.Viewport.Width, cameraBehaviour.Graphics.GraphicsDevice.Viewport.Height);
}
private void ResetCamera(IButtonInputs<Keys> sender, IButtonInputs<Keys>.ButtonCallbackArguments args)