mirror of
https://github.com/ppy/osu
synced 2025-01-25 07:13:22 +00:00
Simplify row tick creation code
This commit is contained in:
parent
7b0d3dfe0c
commit
8347ecf494
@ -117,23 +117,15 @@ namespace osu.Game.Overlays.Profile.Sections.Historical
|
|||||||
var min = values.Select(v => v.Count).Min();
|
var min = values.Select(v => v.Count).Min();
|
||||||
var max = values.Select(v => v.Count).Max();
|
var max = values.Select(v => v.Count).Max();
|
||||||
|
|
||||||
var tick = getTickInterval(max - min, 6);
|
var tickInterval = getTickInterval(max - min, 6);
|
||||||
|
|
||||||
// Prevent infinite loop in case if tick is zero
|
for (long currentTick = 0; currentTick <= max; currentTick += tickInterval)
|
||||||
if (tick == 0)
|
|
||||||
tick = 1;
|
|
||||||
|
|
||||||
double rollingRow = 0;
|
|
||||||
|
|
||||||
while (rollingRow <= max)
|
|
||||||
{
|
{
|
||||||
if (rollingRow >= min)
|
if (currentTick < min)
|
||||||
{
|
continue;
|
||||||
var y = -Interpolation.ValueAt(rollingRow, 0, 1f, min, max);
|
|
||||||
addRowTick(y, rollingRow);
|
|
||||||
}
|
|
||||||
|
|
||||||
rollingRow += tick;
|
float y = -Interpolation.ValueAt(currentTick, 0, 1f, min, max);
|
||||||
|
addRowTick(y, currentTick);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user