From a8f3a0533ac72da3a7abd1696770c27a21b4c692 Mon Sep 17 00:00:00 2001 From: OliBomby Date: Wed, 6 Dec 2023 16:35:59 +0100 Subject: [PATCH] Use 4th order BSpline by default --- .../Editor/TestSceneSliderPlacementBlueprint.cs | 8 ++++---- .../Sliders/Components/PathControlPointVisualiser.cs | 2 +- .../Edit/Blueprints/Sliders/SliderPlacementBlueprint.cs | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/osu.Game.Rulesets.Osu.Tests/Editor/TestSceneSliderPlacementBlueprint.cs b/osu.Game.Rulesets.Osu.Tests/Editor/TestSceneSliderPlacementBlueprint.cs index f889999fe3..bbded55732 100644 --- a/osu.Game.Rulesets.Osu.Tests/Editor/TestSceneSliderPlacementBlueprint.cs +++ b/osu.Game.Rulesets.Osu.Tests/Editor/TestSceneSliderPlacementBlueprint.cs @@ -312,7 +312,7 @@ namespace osu.Game.Rulesets.Osu.Tests.Editor assertPlaced(true); assertLength(808, tolerance: 10); assertControlPointCount(5); - assertControlPointType(0, PathType.BSpline(3)); + assertControlPointType(0, PathType.BSpline(4)); assertControlPointType(1, null); assertControlPointType(2, null); assertControlPointType(3, null); @@ -337,9 +337,9 @@ namespace osu.Game.Rulesets.Osu.Tests.Editor assertPlaced(true); assertLength(600, tolerance: 10); assertControlPointCount(4); - assertControlPointType(0, PathType.BSpline(3)); - assertControlPointType(1, PathType.BSpline(3)); - assertControlPointType(2, PathType.BSpline(3)); + assertControlPointType(0, PathType.BSpline(4)); + assertControlPointType(1, PathType.BSpline(4)); + assertControlPointType(2, PathType.BSpline(4)); assertControlPointType(3, null); } diff --git a/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/Components/PathControlPointVisualiser.cs b/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/Components/PathControlPointVisualiser.cs index 3add95b2b2..24e2210b45 100644 --- a/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/Components/PathControlPointVisualiser.cs +++ b/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/Components/PathControlPointVisualiser.cs @@ -373,7 +373,7 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components curveTypeItems.Add(createMenuItemForPathType(PathType.LINEAR)); curveTypeItems.Add(createMenuItemForPathType(PathType.PERFECT_CURVE)); curveTypeItems.Add(createMenuItemForPathType(PathType.BEZIER)); - curveTypeItems.Add(createMenuItemForPathType(PathType.BSpline(3))); + curveTypeItems.Add(createMenuItemForPathType(PathType.BSpline(4))); if (selectedPieces.Any(piece => piece.ControlPoint.Type?.Type == SplineType.Catmull)) curveTypeItems.Add(createMenuItemForPathType(PathType.CATMULL)); diff --git a/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/SliderPlacementBlueprint.cs b/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/SliderPlacementBlueprint.cs index e13a46d0cd..672ac43f2c 100644 --- a/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/SliderPlacementBlueprint.cs +++ b/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/SliderPlacementBlueprint.cs @@ -49,7 +49,7 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders [Resolved(CanBeNull = true)] private FreehandSliderToolboxGroup freehandToolboxGroup { get; set; } - private readonly IncrementalBSplineBuilder bSplineBuilder = new IncrementalBSplineBuilder(); + private readonly IncrementalBSplineBuilder bSplineBuilder = new IncrementalBSplineBuilder { Degree = 4 }; protected override bool IsValidForPlacement => HitObject.Path.HasValidLength; @@ -239,7 +239,7 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders { if (state == SliderPlacementState.Drawing) { - segmentStart.Type = PathType.BSpline(3); + segmentStart.Type = PathType.BSpline(4); return; } @@ -335,7 +335,7 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders if (segment.Count == 0) continue; - HitObject.Path.ControlPoints.Add(new PathControlPoint(segment[0], PathType.BSpline(3))); + HitObject.Path.ControlPoints.Add(new PathControlPoint(segment[0], PathType.BSpline(4))); for (int j = 1; j < segment.Count - 1; j++) HitObject.Path.ControlPoints.Add(new PathControlPoint(segment[j]));