mirror of
https://github.com/ppy/osu.git
synced 2025-03-29 19:58:40 +08:00
Avoid unnecessarily refreshing SliderBodyPiece
's path
This commit is contained in:
parent
7916b99153
commit
0c7672e124
@ -40,16 +40,23 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components
|
|||||||
body.BorderColour = colours.Yellow;
|
body.BorderColour = colours.Yellow;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private int? lastVersion;
|
||||||
|
|
||||||
public override void UpdateFrom(Slider hitObject)
|
public override void UpdateFrom(Slider hitObject)
|
||||||
{
|
{
|
||||||
base.UpdateFrom(hitObject);
|
base.UpdateFrom(hitObject);
|
||||||
|
|
||||||
body.PathRadius = hitObject.Scale * OsuHitObject.OBJECT_RADIUS;
|
body.PathRadius = hitObject.Scale * OsuHitObject.OBJECT_RADIUS;
|
||||||
|
|
||||||
var vertices = new List<Vector2>();
|
if (lastVersion != hitObject.Path.Version.Value)
|
||||||
hitObject.Path.GetPathToProgress(vertices, 0, 1);
|
{
|
||||||
|
lastVersion = hitObject.Path.Version.Value;
|
||||||
|
|
||||||
body.SetVertices(vertices);
|
var vertices = new List<Vector2>();
|
||||||
|
hitObject.Path.GetPathToProgress(vertices, 0, 1);
|
||||||
|
|
||||||
|
body.SetVertices(vertices);
|
||||||
|
}
|
||||||
|
|
||||||
Size = body.Size;
|
Size = body.Size;
|
||||||
OriginPosition = body.PathOffset;
|
OriginPosition = body.PathOffset;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user