1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-06 06:57:39 +08:00

Fix freeze due to large circular arc radius

Seems to stem from the osu!framework's PathApproximator not catching a few edge cases wherein the radius approaches infinity.
This commit is contained in:
Naxess 2021-03-21 06:34:55 +01:00
parent a294f328fb
commit fcd1f4930f

View File

@ -219,8 +219,10 @@ namespace osu.Game.Rulesets.Objects
List<Vector2> subpath = PathApproximator.ApproximateCircularArc(subControlPoints);
// If for some reason a circular arc could not be fit to the 3 given points, fall back to a numerically stable bezier approximation.
if (subpath.Count == 0)
// If for some reason a circular arc could not be fit to the 3 given points, or the
// resulting radius is too large (e.g. points arranged almost linearly), fall back
// to a numerically stable bezier approximation.
if (subpath.Count == 0 || subpath.Count > 400)
break;
return subpath;