mirror of
https://github.com/ppy/osu
synced 2025-01-25 23:32:58 +00: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)
|
if (hasPath.Path.ControlPoints.Count > 1)
|
||||||
hasPath.Path.ControlPoints[^1].Type = null;
|
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);
|
var newControlPoints = BezierConverter.ConvertToModernBezier(hasPath.Path.ControlPoints);
|
||||||
|
|
||||||
|
@ -164,9 +164,13 @@ namespace osu.Game.Rulesets.Objects
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case SplineType.BSpline:
|
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;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user