mirror of https://github.com/ppy/osu
Ensure sliders are snapped when changing path types
Closes https://github.com/ppy/osu/issues/29915. Uses behaviour suggested in https://github.com/ppy/osu/issues/29915#issuecomment-2361843011.
This commit is contained in:
parent
a258059d43
commit
48b03a328b
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue