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:
parent
a294f328fb
commit
fcd1f4930f
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user