mirror of
https://github.com/ppy/osu.git
synced 2025-02-13 10:33:07 +08:00
Fix KeyCounterDisplay
potentially getting stuck invisible due to autosize masking
Closes #14793.
This commit is contained in:
parent
f5a5b87cf6
commit
a3464c98a7
@ -33,8 +33,6 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
public KeyCounterDisplay()
|
||||
{
|
||||
AutoSizeAxes = Axes.Both;
|
||||
|
||||
InternalChild = KeyFlow = new FillFlowContainer<KeyCounter>
|
||||
{
|
||||
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)
|
||||
{
|
||||
if (key == null) throw new ArgumentNullException(nameof(key));
|
||||
|
Loading…
Reference in New Issue
Block a user