1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-15 13:47:24 +08:00

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

View File

@ -353,6 +353,8 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components
{
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 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components
EnsureValidPathTypes();
if (hitObject.Path.Distance < originalDistance)
hitObject.SnapTo(distanceSnapProvider);
else
hitObject.Path.ExpectedDistance.Value = originalDistance;
changeHandler?.EndChange();
}