Merge branch 'master' into separate-path-connection

This commit is contained in:
Dean Herbert
2019-12-11 16:43:04 +09:00
committed by GitHub
53 changed files with 481 additions and 299 deletions

View File

@ -136,8 +136,8 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components
slider.Path.ControlPoints.Remove(c);
}
// If there are 0 remaining control points, treat the slider as being deleted
if (slider.Path.ControlPoints.Count == 0)
// If there are 0 or 1 remaining control points, the slider is in a degenerate (single point) form and should be deleted
if (slider.Path.ControlPoints.Count <= 1)
{
placementHandler?.Delete(slider);
return true;
@ -171,7 +171,7 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components
return new MenuItem[]
{
new OsuMenuItem($"Delete {"control point".ToQuantity(selectedPoints)}", MenuItemType.Destructive, () => deleteSelected())
new OsuMenuItem($"Delete {"control point".ToQuantity(selectedPoints, selectedPoints > 1 ? ShowQuantityAs.Numeric : ShowQuantityAs.None)}", MenuItemType.Destructive, () => deleteSelected())
};
}
}

View File

@ -1,7 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System.Collections.Generic;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Input;
@ -191,15 +190,5 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders
Initial,
Body,
}
private class Segment
{
public readonly List<Vector2> ControlPoints = new List<Vector2>();
public Segment(Vector2 offset)
{
ControlPoints.Add(offset);
}
}
}
}

View File

@ -104,7 +104,7 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders
int insertionIndex = 0;
float minDistance = float.MaxValue;
for (int i = 0; i < HitObject.Path.ControlPoints.Count - 2; i++)
for (int i = 0; i < HitObject.Path.ControlPoints.Count - 1; i++)
{
float dist = new Line(HitObject.Path.ControlPoints[i].Position.Value, HitObject.Path.ControlPoints[i + 1].Position.Value).DistanceToPoint(position);