mirror of
https://github.com/ppy/osu.git
synced 2024-11-15 18:37:52 +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:
parent
a258059d43
commit
48b03a328b
@ -353,6 +353,8 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components
|
|||||||
{
|
{
|
||||||
changeHandler?.BeginChange();
|
changeHandler?.BeginChange();
|
||||||
|
|
||||||
|
double originalDistance = hitObject.Path.Distance;
|
||||||
|
|
||||||
foreach (var p in Pieces.Where(p => p.IsSelected.Value))
|
foreach (var p in Pieces.Where(p => p.IsSelected.Value))
|
||||||
{
|
{
|
||||||
var pointsInSegment = hitObject.Path.PointsInSegment(p.ControlPoint);
|
var pointsInSegment = hitObject.Path.PointsInSegment(p.ControlPoint);
|
||||||
@ -375,6 +377,11 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components
|
|||||||
|
|
||||||
EnsureValidPathTypes();
|
EnsureValidPathTypes();
|
||||||
|
|
||||||
|
if (hitObject.Path.Distance < originalDistance)
|
||||||
|
hitObject.SnapTo(distanceSnapProvider);
|
||||||
|
else
|
||||||
|
hitObject.Path.ExpectedDistance.Value = originalDistance;
|
||||||
|
|
||||||
changeHandler?.EndChange();
|
changeHandler?.EndChange();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user