mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 23:12:56 +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 ShakeContainer shakeContainer;
|
||||||
|
|
||||||
|
private Vector2? childAnchorPosition;
|
||||||
|
|
||||||
protected override IEnumerable<Drawable> DimmablePieces => new Drawable[]
|
protected override IEnumerable<Drawable> DimmablePieces => new Drawable[]
|
||||||
{
|
{
|
||||||
HeadCircle,
|
HeadCircle,
|
||||||
@ -254,10 +256,15 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
|||||||
|
|
||||||
if (DrawSize != Vector2.Zero)
|
if (DrawSize != Vector2.Zero)
|
||||||
{
|
{
|
||||||
var childAnchorPosition = Vector2.Divide(OriginPosition, DrawSize);
|
Vector2 pos = Vector2.Divide(OriginPosition, DrawSize);
|
||||||
|
|
||||||
|
if (pos != childAnchorPosition)
|
||||||
|
{
|
||||||
|
childAnchorPosition = pos;
|
||||||
foreach (var obj in NestedHitObjects)
|
foreach (var obj in NestedHitObjects)
|
||||||
obj.RelativeAnchorPosition = childAnchorPosition;
|
obj.RelativeAnchorPosition = pos;
|
||||||
Ball.RelativeAnchorPosition = childAnchorPosition;
|
Ball.RelativeAnchorPosition = pos;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user