mirror of
https://github.com/osukey/osukey.git
synced 2025-05-03 20:57:28 +09: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 osuTK.Graphics;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Layout;
|
||||||
using osu.Framework.Threading;
|
using osu.Framework.Threading;
|
||||||
|
|
||||||
namespace osu.Game.Screens.Play
|
namespace osu.Game.Screens.Play
|
||||||
@ -51,7 +52,7 @@ namespace osu.Game.Screens.Play
|
|||||||
if (value == values) return;
|
if (value == values) return;
|
||||||
|
|
||||||
values = value;
|
values = value;
|
||||||
graphNeedsUpdate = true;
|
layout.Invalidate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -71,23 +72,25 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
private ScheduledDelegate scheduledCreate;
|
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()
|
protected override void Update()
|
||||||
{
|
{
|
||||||
base.Update();
|
base.Update();
|
||||||
|
|
||||||
if (graphNeedsUpdate || (values != null && DrawSize != previousDrawSize))
|
if (!layout.IsValid)
|
||||||
{
|
{
|
||||||
columns?.FadeOut(500, Easing.OutQuint).Expire();
|
columns?.FadeOut(500, Easing.OutQuint).Expire();
|
||||||
|
|
||||||
scheduledCreate?.Cancel();
|
scheduledCreate?.Cancel();
|
||||||
scheduledCreate = Scheduler.AddDelayed(RecreateGraph, 500);
|
scheduledCreate = Scheduler.AddDelayed(RecreateGraph, 500);
|
||||||
|
|
||||||
previousDrawSize = DrawSize;
|
layout.Validate();
|
||||||
graphNeedsUpdate = false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user