1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-07 21:32:57 +08:00

Use a cleaner distance function

This commit is contained in:
smoogipoo 2019-10-16 19:32:45 +09:00
parent f3c38ae089
commit 5ac5e34f85

View File

@ -18,13 +18,9 @@ namespace osu.Game.Screens.Edit.Compose.Components
protected override void CreateContent(Vector2 centrePosition) protected override void CreateContent(Vector2 centrePosition)
{ {
float maxDistance = Math.Max( float dx = Math.Max(centrePosition.X, DrawWidth - centrePosition.X);
Vector2.Distance(centrePosition, Vector2.Zero), float dy = Math.Max(centrePosition.Y, DrawHeight - centrePosition.Y);
Math.Max( float maxDistance = new Vector2(dx, dy).Length;
Vector2.Distance(centrePosition, new Vector2(DrawWidth, 0)),
Math.Max(
Vector2.Distance(centrePosition, new Vector2(0, DrawHeight)),
Vector2.Distance(centrePosition, DrawSize))));
int requiredCircles = (int)(maxDistance / DistanceSpacing); int requiredCircles = (int)(maxDistance / DistanceSpacing);