mirror of
https://github.com/ppy/osu.git
synced 2025-01-14 19:22:56 +08:00
Merge pull request #23451 from timiimit/fix-default-progress-graph-flipping
Fix default progress graph not updating after flip
This commit is contained in:
commit
592fcafcd4
@ -15,6 +15,7 @@ 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
|
||||
@ -51,7 +52,7 @@ namespace osu.Game.Screens.Play
|
||||
if (value == values) return;
|
||||
|
||||
values = value;
|
||||
graphNeedsUpdate = true;
|
||||
layout.Invalidate();
|
||||
}
|
||||
}
|
||||
|
||||
@ -71,23 +72,25 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
private ScheduledDelegate scheduledCreate;
|
||||
|
||||
private bool graphNeedsUpdate;
|
||||
private readonly LayoutValue layout = new LayoutValue(Invalidation.DrawSize | Invalidation.DrawInfo);
|
||||
|
||||
private Vector2 previousDrawSize;
|
||||
public SquareGraph()
|
||||
{
|
||||
AddLayout(layout);
|
||||
}
|
||||
|
||||
protected override void Update()
|
||||
{
|
||||
base.Update();
|
||||
|
||||
if (graphNeedsUpdate || (values != null && DrawSize != previousDrawSize))
|
||||
if (!layout.IsValid)
|
||||
{
|
||||
columns?.FadeOut(500, Easing.OutQuint).Expire();
|
||||
|
||||
scheduledCreate?.Cancel();
|
||||
scheduledCreate = Scheduler.AddDelayed(RecreateGraph, 500);
|
||||
|
||||
previousDrawSize = DrawSize;
|
||||
graphNeedsUpdate = false;
|
||||
layout.Validate();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user