mirror of
https://github.com/ppy/osu.git
synced 2025-03-19 09:07:18 +08:00
Add inline comment explaining necessity to use AddRange
for slider transform operations
This commit is contained in:
parent
65f7ecec83
commit
36e202c70e
@ -133,6 +133,8 @@ namespace osu.Game.Rulesets.Osu.Edit
|
||||
(direction == Direction.Vertical ? -1 : 1) * p.Position.Y
|
||||
), p.Type)).ToArray();
|
||||
|
||||
// Importantly, update as a single operation so automatic adjustment of control points to different
|
||||
// curve types does not unexpectedly trigger and change the slider's shape.
|
||||
slider.Path.ControlPoints.Clear();
|
||||
slider.Path.ControlPoints.AddRange(controlPoints);
|
||||
}
|
||||
@ -187,6 +189,8 @@ namespace osu.Game.Rulesets.Osu.Edit
|
||||
var controlPoints = path.Path.ControlPoints.Select(p =>
|
||||
new PathControlPoint(RotatePointAroundOrigin(p.Position, Vector2.Zero, delta), p.Type)).ToArray();
|
||||
|
||||
// Importantly, update as a single operation so automatic adjustment of control points to different
|
||||
// curve types does not unexpectedly trigger and change the slider's shape.
|
||||
path.Path.ControlPoints.Clear();
|
||||
path.Path.ControlPoints.AddRange(controlPoints);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user