mirror of https://github.com/ppy/osu
Merge pull request #30063 from bdach/snap-sliders-on-path-type-change
Ensure sliders are snapped when changing path types
This commit is contained in:
commit
0bff7e8697
|
@ -353,6 +353,8 @@ private void updatePathTypeOfSelectedPieces(PathType? type)
|
|||
{
|
||||
changeHandler?.BeginChange();
|
||||
|
||||
double originalDistance = hitObject.Path.Distance;
|
||||
|
||||
foreach (var p in Pieces.Where(p => p.IsSelected.Value))
|
||||
{
|
||||
var pointsInSegment = hitObject.Path.PointsInSegment(p.ControlPoint);
|
||||
|
@ -375,6 +377,11 @@ private void updatePathTypeOfSelectedPieces(PathType? type)
|
|||
|
||||
EnsureValidPathTypes();
|
||||
|
||||
if (hitObject.Path.Distance < originalDistance)
|
||||
hitObject.SnapTo(distanceSnapProvider);
|
||||
else
|
||||
hitObject.Path.ExpectedDistance.Value = originalDistance;
|
||||
|
||||
changeHandler?.EndChange();
|
||||
}
|
||||
|
||||
|
|
|
@ -112,6 +112,7 @@ public void TestConversionsWithSliderVelocity()
|
|||
{
|
||||
SliderVelocityMultiplier = slider_velocity
|
||||
};
|
||||
AddStep("add to beatmap", () => composer.EditorBeatmap.Add(referenceObject));
|
||||
|
||||
assertSnapDistance(base_distance * slider_velocity, referenceObject, true);
|
||||
assertSnappedDistance(base_distance * slider_velocity + 10, base_distance * slider_velocity, referenceObject);
|
||||
|
|
Loading…
Reference in New Issue