mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 08:52:55 +08:00
Avoid iteration over NestedHitObjects
in silder's Update
unless necessary
This commit is contained in:
parent
35eff639cb
commit
5cc4a586ac
@ -36,6 +36,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
||||
|
||||
private ShakeContainer shakeContainer;
|
||||
|
||||
private Vector2? childAnchorPosition;
|
||||
|
||||
protected override IEnumerable<Drawable> DimmablePieces => new Drawable[]
|
||||
{
|
||||
HeadCircle,
|
||||
@ -254,10 +256,15 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
||||
|
||||
if (DrawSize != Vector2.Zero)
|
||||
{
|
||||
var childAnchorPosition = Vector2.Divide(OriginPosition, DrawSize);
|
||||
foreach (var obj in NestedHitObjects)
|
||||
obj.RelativeAnchorPosition = childAnchorPosition;
|
||||
Ball.RelativeAnchorPosition = childAnchorPosition;
|
||||
Vector2 pos = Vector2.Divide(OriginPosition, DrawSize);
|
||||
|
||||
if (pos != childAnchorPosition)
|
||||
{
|
||||
childAnchorPosition = pos;
|
||||
foreach (var obj in NestedHitObjects)
|
||||
obj.RelativeAnchorPosition = pos;
|
||||
Ball.RelativeAnchorPosition = pos;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user