1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-06 09:07:25 +08:00

moving all controlpoints at once for slider

This commit is contained in:
OliBomby 2022-08-20 00:26:04 +02:00
parent 4ef8e00a78
commit 65f7ecec83

View File

@ -127,13 +127,14 @@ namespace osu.Game.Rulesets.Osu.Edit
{
didFlip = true;
foreach (var point in slider.Path.ControlPoints)
{
point.Position = new Vector2(
(direction == Direction.Horizontal ? -1 : 1) * point.Position.X,
(direction == Direction.Vertical ? -1 : 1) * point.Position.Y
);
}
var controlPoints = slider.Path.ControlPoints.Select(p =>
new PathControlPoint(new Vector2(
(direction == Direction.Horizontal ? -1 : 1) * p.Position.X,
(direction == Direction.Vertical ? -1 : 1) * p.Position.Y
), p.Type)).ToArray();
slider.Path.ControlPoints.Clear();
slider.Path.ControlPoints.AddRange(controlPoints);
}
}
@ -183,8 +184,11 @@ namespace osu.Game.Rulesets.Osu.Edit
if (h is IHasPath path)
{
foreach (var point in path.Path.ControlPoints)
point.Position = RotatePointAroundOrigin(point.Position, Vector2.Zero, delta);
var controlPoints = path.Path.ControlPoints.Select(p =>
new PathControlPoint(RotatePointAroundOrigin(p.Position, Vector2.Zero, delta), p.Type)).ToArray();
path.Path.ControlPoints.Clear();
path.Path.ControlPoints.AddRange(controlPoints);
}
}