1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 17:52:56 +08:00

Update PointsInSegment when adding/removing points

There was a bug where if you created a slider, moved the last point, and then added a point such that it became a PerfectCurve, it would fail to recover after becoming a Bezier.

This fixes that.
This commit is contained in:
Naxess 2021-03-24 02:56:32 +01:00
parent e922e67c98
commit 5ee280f941

View File

@ -29,10 +29,10 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components
public class PathControlPointPiece : BlueprintPiece<Slider>, IHasTooltip
{
public Action<PathControlPointPiece, MouseButtonEvent> RequestSelection;
public List<PathControlPoint> PointsInSegment;
public readonly BindableBool IsSelected = new BindableBool();
public readonly PathControlPoint ControlPoint;
public readonly List<PathControlPoint> PointsInSegment;
private readonly Slider slider;
private readonly Container marker;
@ -55,7 +55,10 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components
{
this.slider = slider;
ControlPoint = controlPoint;
PointsInSegment = slider.Path.PointsInSegment(controlPoint);
slider.Path.ControlPoints.BindCollectionChanged((_, args) =>
{
PointsInSegment = slider.Path.PointsInSegment(controlPoint);
}, runOnceImmediately: true);
controlPoint.Type.BindValueChanged(_ => updateMarkerDisplay());