1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-15 23:42:55 +08:00

Merge pull request #20321 from HiddenNode/fix_graph_info_overlap

Fix Progress bar info text overlapping with progress graph
This commit is contained in:
Dan Balasescu 2022-09-20 19:30:51 +09:00 committed by GitHub
commit 7f15dc6e6c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 14 deletions

View File

@ -47,10 +47,7 @@ namespace osu.Game.Screens.Play.HUD
if (clock != null)
gameplayClock = clock;
// Lock height so changes in text autosize (if character height changes)
// don't cause parent invalidation.
Height = 14;
AutoSizeAxes = Axes.Y;
Children = new Drawable[]
{
new Container

View File

@ -15,7 +15,6 @@ using osuTK;
using osuTK.Graphics;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Allocation;
using osu.Framework.Layout;
using osu.Framework.Threading;
namespace osu.Game.Screens.Play
@ -24,11 +23,6 @@ namespace osu.Game.Screens.Play
{
private BufferedContainer<Column> columns;
public SquareGraph()
{
AddLayout(layout);
}
public int ColumnCount => columns?.Children.Count ?? 0;
private int progress;
@ -57,7 +51,7 @@ namespace osu.Game.Screens.Play
if (value == values) return;
values = value;
layout.Invalidate();
graphNeedsUpdate = true;
}
}
@ -75,21 +69,25 @@ namespace osu.Game.Screens.Play
}
}
private readonly LayoutValue layout = new LayoutValue(Invalidation.DrawSize);
private ScheduledDelegate scheduledCreate;
private bool graphNeedsUpdate;
private Vector2 previousDrawSize;
protected override void Update()
{
base.Update();
if (values != null && !layout.IsValid)
if (graphNeedsUpdate || (values != null && DrawSize != previousDrawSize))
{
columns?.FadeOut(500, Easing.OutQuint).Expire();
scheduledCreate?.Cancel();
scheduledCreate = Scheduler.AddDelayed(RecreateGraph, 500);
layout.Validate();
previousDrawSize = DrawSize;
graphNeedsUpdate = false;
}
}