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:
Bartłomiej Dach 2024-09-30 14:26:30 +02:00
parent a258059d43
commit 48b03a328b
No known key found for this signature in database
1 changed files with 7 additions and 0 deletions

View File

@ -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();
}