mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 16:29:58 +09:00
Use MathF instead of Math- functions when possible
MathF-functions are faster than the Math-counterpart and it looks cleaner, so use MathF when we cast to float or int anyway.
This commit is contained in:
@ -75,7 +75,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
||||
float distance = direction.Length;
|
||||
|
||||
float radius = DistanceSpacing;
|
||||
int radialCount = Math.Clamp((int)Math.Round(distance / radius), 1, MaxIntervals);
|
||||
int radialCount = Math.Clamp((int)MathF.Round(distance / radius), 1, MaxIntervals);
|
||||
|
||||
Vector2 normalisedDirection = direction * new Vector2(1f / distance);
|
||||
Vector2 snappedPosition = CentrePosition + normalisedDirection * radialCount * radius;
|
||||
|
Reference in New Issue
Block a user