fix: Window clamp applies the UI scale twice
This commit is contained in:
1 parent
993b91a46b
commit
be429a9448
1 file changed
+2
-1
@@ -108,7 +108,8 @@ public static class WindowManager
|
|||||||
Unfocus();
|
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)
|
public static void Draw(SpriteBatch spriteBatch)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in new issue
Block a user