fix: Window clamp applies the UI scale twice

This commit is contained in:
VAC committed 2026-10-16 00:18:05 -03:00
1 parent 993b91a46b
commit be429a9448
1 file changed
+2 -1
+2 -1
View File
@@ -108,7 +108,8 @@ public static class WindowManager
Unfocus();
}
static Vector2 ClampPosition(Window window, Vector2 position) => new(MathHelper.Clamp(position.X, 0f, Math.Max(0f, Main.screenWidth / Main.UIScale - window.Width)), MathHelper.Clamp(position.Y, 0f, Math.Max(0f, Main.screenHeight / Main.UIScale - window.Height)));
// PlayerInput.SetZoom_UI already divides Main.screenWidth/Height by the UI scale inside UI layers.
static Vector2 ClampPosition(Window window, Vector2 position) => new(MathHelper.Clamp(position.X, 0f, Math.Max(0f, PlayerInput.RealScreenWidth / Main.UIScale - window.Width)), MathHelper.Clamp(position.Y, 0f, Math.Max(0f, PlayerInput.RealScreenHeight / Main.UIScale - window.Height)));
public static void Draw(SpriteBatch spriteBatch)
{