More robust implementation

This commit is contained in:
timiimit 2023-05-09 17:15:54 +02:00
parent 84efddcbc7
commit ad80e2ff51

View File

@ -81,20 +81,31 @@ namespace osu.Game.Screens.Play
{ {
base.Update(); base.Update();
bool hasFlipped = previousParentScale != Parent.Scale; bool extraUpdateConditions =
if (graphNeedsUpdate || (values != null && DrawSize != previousDrawSize) || hasFlipped) DrawSize != previousDrawSize ||
previousParentScale != Parent.Scale;
if (graphNeedsUpdate || (values != null && extraUpdateConditions))
{ {
scheduledCreate?.Cancel(); bool hasFlipped =
previousParentScale.X == -Parent.Scale.X ||
previousParentScale.Y == -Parent.Scale.Y;
if (!hasFlipped) if (!hasFlipped)
{ {
scheduledCreate = Scheduler.AddDelayed(RecreateGraph, 500); columns?.FadeOut(500, Easing.OutQuint).Expire();
} }
else else
{ {
RecreateGraph(); if (columns != null)
{
columns.Alpha = 0.0f;
}
} }
scheduledCreate?.Cancel();
scheduledCreate = Scheduler.AddDelayed(RecreateGraph, 500);
previousDrawSize = DrawSize; previousDrawSize = DrawSize;
previousParentScale = Parent.Scale; previousParentScale = Parent.Scale;
graphNeedsUpdate = false; graphNeedsUpdate = false;