fix(SegmentedGraph): update graphNeedsUpdate variable during Update() loop

This commit is contained in:
tsrk
2023-01-12 02:36:35 +01:00
parent 624e90b213
commit 5694487a7b
2 changed files with 15 additions and 18 deletions

View File

@ -41,9 +41,7 @@ namespace osu.Game.Graphics.UserInterface
if (value == values) return;
values = value;
recalculateTiers(values);
graphNeedsUpdate = true;
Invalidate(Invalidation.DrawNode);
}
}
@ -65,8 +63,10 @@ namespace osu.Game.Graphics.UserInterface
if (graphNeedsUpdate)
{
recalculateTiers(values);
recalculateSegments();
Invalidate(Invalidation.DrawNode);
graphNeedsUpdate = false;
}
}
@ -170,6 +170,11 @@ namespace osu.Game.Graphics.UserInterface
/// The value is a normalized float (from 0 to 1).
/// </remarks>
public float Length => End - Start;
public override string ToString()
{
return $"({Tier}, {Start * 100}%, {End * 100}%)";
}
}
private class SegmentedGraphDrawNode : DrawNode