Fix logic in recalculateValues()

This commit is contained in:
timiimit 2023-05-13 01:27:28 +02:00
parent b79967a9f9
commit 159cacf9c7

View File

@ -139,18 +139,19 @@ namespace osu.Game.Screens.Play
if (values == null) if (values == null)
{ {
for (float i = 0; i < ColumnCount; i++) for (float i = 0; i < ColumnCount; i++)
{
newValues.Add(0); newValues.Add(0);
return;
} }
}
else
{
int max = values.Max(); int max = values.Max();
float step = values.Length / (float)ColumnCount; float step = values.Length / (float)ColumnCount;
for (float i = 0; i < values.Length; i += step) for (float i = 0; i < values.Length; i += step)
{ {
newValues.Add((float)values[(int)i] / max); newValues.Add((float)values[(int)i] / max);
}
} }
calculatedValues = newValues.ToArray(); calculatedValues = newValues.ToArray();