Use static local functions.

This commit is contained in:
Huo Yaoyuan
2019-11-12 18:37:20 +08:00
parent dcfa98414f
commit 144812669d
14 changed files with 22 additions and 18 deletions

View File

@ -116,7 +116,7 @@ namespace osu.Game.Rulesets.Objects.Legacy
}
// osu-stable special-cased colinear perfect curves to a CurveType.Linear
bool isLinear(Vector2[] p) => Precision.AlmostEquals(0, (p[1].Y - p[0].Y) * (p[2].X - p[0].X) - (p[1].X - p[0].X) * (p[2].Y - p[0].Y));
static bool isLinear(Vector2[] p) => Precision.AlmostEquals(0, (p[1].Y - p[0].Y) * (p[2].X - p[0].X) - (p[1].X - p[0].X) * (p[2].Y - p[0].Y));
if (points.Length == 3 && pathType == PathType.PerfectCurve && isLinear(points))
pathType = PathType.Linear;