mirror of
https://github.com/ppy/osu.git
synced 2025-01-14 19:22:56 +08:00
Invert if statement
This commit is contained in:
parent
6911a1b415
commit
80e7c3aba7
@ -211,8 +211,9 @@ namespace osu.Game.Rulesets.Objects
|
||||
|
||||
// An almost linear arrangement of points results in radius approaching infinity,
|
||||
// we should prevent that to avoid memory exhaustion when drawing / approximating
|
||||
if (pathType == PathType.PerfectCurve)
|
||||
{
|
||||
if (pathType != PathType.PerfectCurve)
|
||||
return;
|
||||
|
||||
Vector2[] points = pointsInSegment.Select(point => point.Position.Value).ToArray();
|
||||
if (points.Length < 3)
|
||||
return;
|
||||
@ -242,13 +243,6 @@ namespace osu.Game.Rulesets.Objects
|
||||
if (Math.Abs(det) < threshold)
|
||||
pointsInSegment[0].Type.Value = PathType.Bezier;
|
||||
}
|
||||
// where the latter is much faster, hence differing thresholds
|
||||
bool exterior = abSq > acSq || bcSq > acSq;
|
||||
float threshold = exterior ? 0.05f : 0.001f;
|
||||
|
||||
if (Math.Abs(det) < threshold)
|
||||
pointsInSegment[0].Type.Value = PathType.Bezier;
|
||||
}
|
||||
|
||||
private void invalidate()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user