1
0
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:
Bartłomiej Dach 2023-05-14 19:19:10 +02:00 committed by GitHub
commit 592fcafcd4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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();
}
}