1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-26 12:45:09 +08:00

Merge pull request #14814 from peppy/fix-key-counter-masking

Fix `KeyCounterDisplay` potentially getting stuck invisible due to autosize masking
This commit is contained in:
Dan Balasescu 2021-09-21 16:21:38 +09:00 committed by GitHub
commit ffdaf23329
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -33,8 +33,6 @@ namespace osu.Game.Screens.Play
public KeyCounterDisplay() public KeyCounterDisplay()
{ {
AutoSizeAxes = Axes.Both;
InternalChild = KeyFlow = new FillFlowContainer<KeyCounter> InternalChild = KeyFlow = new FillFlowContainer<KeyCounter>
{ {
Direction = FillDirection.Horizontal, Direction = FillDirection.Horizontal,
@ -42,6 +40,15 @@ namespace osu.Game.Screens.Play
}; };
} }
protected override void Update()
{
base.Update();
// Don't use autosize as it will shrink to zero when KeyFlow is hidden.
// In turn this can cause the display to be masked off screen and never become visible again.
Size = KeyFlow.Size;
}
public override void Add(KeyCounter key) public override void Add(KeyCounter key)
{ {
if (key == null) throw new ArgumentNullException(nameof(key)); if (key == null) throw new ArgumentNullException(nameof(key));