mirror of
https://github.com/ppy/osu.git
synced 2025-02-13 16:02:58 +08:00
Calculate the diagonal length using Vector2.LengthFast
instead of manually
This commit is contained in:
parent
e6b28e1386
commit
80cb7c77b9
@ -147,7 +147,7 @@ namespace osu.Game.Rulesets.Osu.Mods
|
|||||||
if (barrelRollActive)
|
if (barrelRollActive)
|
||||||
{
|
{
|
||||||
float center = restrictTo.ToSpaceOfOtherDrawable(restrictTo.OriginPosition, Parent).X;
|
float center = restrictTo.ToSpaceOfOtherDrawable(restrictTo.OriginPosition, Parent).X;
|
||||||
float halfDiagonal = MathF.Sqrt(MathF.Pow(restrictTo.DrawWidth / 2, 2) + MathF.Pow(restrictTo.DrawHeight / 2, 2));
|
float halfDiagonal = (restrictTo.DrawSize / 2).LengthFast;
|
||||||
|
|
||||||
start = center - halfDiagonal;
|
start = center - halfDiagonal;
|
||||||
end = center + halfDiagonal;
|
end = center + halfDiagonal;
|
||||||
|
Loading…
Reference in New Issue
Block a user