mirror of
https://github.com/ppy/osu.git
synced 2024-09-22 00:47:24 +08:00
Remember ContolPoint positions instead of recalculating them
This commit is contained in:
parent
e67ab3cca7
commit
5d272bef97
@ -197,8 +197,13 @@ namespace osu.Game.Rulesets.Osu.Edit
|
|||||||
Quad sliderQuad = getSurroundingQuad(slider.Path.ControlPoints.Select(p => p.Position.Value));
|
Quad sliderQuad = getSurroundingQuad(slider.Path.ControlPoints.Select(p => p.Position.Value));
|
||||||
Vector2 pathRelativeDeltaScale = new Vector2(1 + scale.X / sliderQuad.Width, 1 + scale.Y / sliderQuad.Height);
|
Vector2 pathRelativeDeltaScale = new Vector2(1 + scale.X / sliderQuad.Width, 1 + scale.Y / sliderQuad.Height);
|
||||||
|
|
||||||
|
Queue<Vector2> oldControlPoints = new Queue<Vector2>();
|
||||||
|
|
||||||
foreach (var point in slider.Path.ControlPoints)
|
foreach (var point in slider.Path.ControlPoints)
|
||||||
|
{
|
||||||
|
oldControlPoints.Enqueue(point.Position.Value);
|
||||||
point.Position.Value *= pathRelativeDeltaScale;
|
point.Position.Value *= pathRelativeDeltaScale;
|
||||||
|
}
|
||||||
|
|
||||||
//if sliderhead or sliderend end up outside playfield, revert scaling.
|
//if sliderhead or sliderend end up outside playfield, revert scaling.
|
||||||
Quad scaledQuad = getSurroundingQuad(new OsuHitObject[] { slider });
|
Quad scaledQuad = getSurroundingQuad(new OsuHitObject[] { slider });
|
||||||
@ -207,8 +212,8 @@ namespace osu.Game.Rulesets.Osu.Edit
|
|||||||
if (xInBounds && yInBounds)
|
if (xInBounds && yInBounds)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
foreach (var point in slider.Path.ControlPoints)
|
foreach(var point in slider.Path.ControlPoints)
|
||||||
point.Position.Value *= new Vector2(1 / pathRelativeDeltaScale.X, 1 / pathRelativeDeltaScale.Y);
|
point.Position.Value = oldControlPoints.Dequeue();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user