1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-15 06:42:56 +08:00

address reviews

This commit is contained in:
Samaoo 2022-11-12 08:49:03 +01:00
parent 268011be9e
commit 7a860fb460
2 changed files with 10 additions and 10 deletions

View File

@ -212,17 +212,17 @@ namespace osu.Game.Overlays.Settings.Sections.Input
{
base.Update();
if (tablet.Value?.Size is Vector2 size)
{
float maxDimension = size.LengthFast;
if (!(tablet.Value?.Size is Vector2 size))
return;
float fitX = maxDimension / (DrawWidth - Padding.Left - Padding.Right);
float fitY = maxDimension / DrawHeight;
float maxDimension = size.LengthFast;
float adjust = MathF.Max(fitX, fitY);
float fitX = maxDimension / (DrawWidth - Padding.Left - Padding.Right);
float fitY = maxDimension / DrawHeight;
tabletContainer.Scale = new Vector2(1 / adjust);
}
float adjust = MathF.Max(fitX, fitY);
tabletContainer.Scale = new Vector2(1 / adjust);
}
}
}

View File

@ -342,8 +342,8 @@ namespace osu.Game.Overlays.Settings.Sections.Input
private float currentAspectRatio => sizeX.Value / sizeY.Value;
private static float getHeight(float width, float aspectRatio) => MathF.Round(width / aspectRatio);
private static float getHeight(float width, float aspectRatio) => width / aspectRatio;
private static float getWidth(float height, float aspectRatio) => MathF.Round(height * aspectRatio);
private static float getWidth(float height, float aspectRatio) => height * aspectRatio;
}
}