Merge pull request #10842 from EVAST9919/profile-overlay-graph-new

Implement history charts for Profile Overlay
This commit is contained in:
Dean Herbert
2020-11-24 18:05:17 +09:00
committed by GitHub
7 changed files with 569 additions and 1 deletions

View File

@ -119,7 +119,11 @@ namespace osu.Game.Graphics.UserInterface
protected float GetYPosition(float value)
{
if (ActualMaxValue == ActualMinValue) return 0;
if (ActualMaxValue == ActualMinValue)
// show line at top if the only value on the graph is positive,
// and at bottom if the only value on the graph is zero or negative.
// just kind of makes most sense intuitively.
return value > 1 ? 0 : 1;
return (ActualMaxValue - value) / (ActualMaxValue - ActualMinValue);
}