mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 10:07:52 +08:00
Fix incorrect legacy conversion when B-splines are used
This commit is contained in:
parent
80a3225bb2
commit
6d7d826b8b
@ -85,7 +85,8 @@ namespace osu.Game.Database
|
||||
if (hasPath.Path.ControlPoints.Count > 1)
|
||||
hasPath.Path.ControlPoints[^1].Type = null;
|
||||
|
||||
if (BezierConverter.CountSegments(hasPath.Path.ControlPoints) <= 1) continue;
|
||||
if (BezierConverter.CountSegments(hasPath.Path.ControlPoints) <= 1
|
||||
&& hasPath.Path.ControlPoints[0].Type!.Value.Degree == null) continue;
|
||||
|
||||
var newControlPoints = BezierConverter.ConvertToModernBezier(hasPath.Path.ControlPoints);
|
||||
|
||||
|
@ -164,9 +164,13 @@ namespace osu.Game.Rulesets.Objects
|
||||
break;
|
||||
|
||||
case SplineType.BSpline:
|
||||
for (int j = 0; j < segmentVertices.Length - 1; j++)
|
||||
var bSplineResult = segmentType.Degree == null
|
||||
? segmentVertices
|
||||
: PathApproximator.BSplineToBezier(segmentVertices, segmentType.Degree.Value);
|
||||
|
||||
for (int j = 0; j < bSplineResult.Length - 1; j++)
|
||||
{
|
||||
result.Add(new PathControlPoint(segmentVertices[j], j == 0 ? segmentType : null));
|
||||
result.Add(new PathControlPoint(bSplineResult[j], j == 0 ? PathType.BEZIER : null));
|
||||
}
|
||||
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user