Centralise length validation function

This commit is contained in:
Dean Herbert
2021-04-16 15:22:32 +09:00
parent 965a1ead36
commit d38e294d96
2 changed files with 3 additions and 1 deletions

View File

@ -135,7 +135,7 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders
private void endCurve() private void endCurve()
{ {
updateSlider(); updateSlider();
EndPlacement(HitObject.Path.ExpectedDistance?.Value > 0); EndPlacement(HitObject.Path.HasValidLength);
} }
protected override void Update() protected override void Update()

View File

@ -30,6 +30,8 @@ namespace osu.Game.Rulesets.Objects
/// </summary> /// </summary>
public readonly Bindable<double?> ExpectedDistance = new Bindable<double?>(); public readonly Bindable<double?> ExpectedDistance = new Bindable<double?>();
public bool HasValidLength => Distance > 0;
/// <summary> /// <summary>
/// The control points of the path. /// The control points of the path.
/// </summary> /// </summary>