1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-21 06:02:56 +08:00

Fix potential wrong thread mutation in ColourHitErrorMeter

This commit is contained in:
Dean Herbert 2021-12-21 12:36:01 +09:00
parent 377cb1d9e3
commit 28d6ff5d9c

View File

@ -53,13 +53,13 @@ namespace osu.Game.Screens.Play.HUD.HitErrorMeters
LayoutEasing = Easing.OutQuint; LayoutEasing = Easing.OutQuint;
} }
public void Push(Color4 colour) public void Push(Color4 colour) => Schedule(() =>
{ {
Add(new HitErrorCircle(colour, drawable_judgement_size)); Add(new HitErrorCircle(colour, drawable_judgement_size));
if (Children.Count > max_available_judgements) if (Children.Count > max_available_judgements)
Children.FirstOrDefault(c => !c.IsRemoved)?.Remove(); Children.FirstOrDefault(c => !c.IsRemoved)?.Remove();
} });
} }
internal class HitErrorCircle : Container internal class HitErrorCircle : Container