1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 15:27:26 +08:00

Fixed columns not being able to have zero fill

This commit is contained in:
DrabWeb 2017-02-09 19:29:12 -04:00
parent 843b58c8f4
commit 0327c46d36
3 changed files with 12 additions and 2 deletions

View File

@ -41,7 +41,7 @@ namespace osu.Desktop.VisualTests
List<int> newValues = new List<int>(); List<int> newValues = new List<int>();
for (int i = 0; i < 1000; i++) for (int i = 0; i < 1000; i++)
{ {
newValues.Add(random.Next(1, 11)); newValues.Add(random.Next(0, 11));
} }
progress.DisplayValues(newValues); progress.DisplayValues(newValues);

View File

@ -70,6 +70,9 @@ namespace osu.Game.Screens.Play
private void recalculateValues() private void recalculateValues()
{ {
// Resizes values to fit the amount of columns and stores it in calculatedValues
// Defaults to all zeros if values is null
calculatedValues.RemoveAll(delegate { return true; }); calculatedValues.RemoveAll(delegate { return true; });
if (values == null) if (values == null)

View File

@ -58,10 +58,17 @@ namespace osu.Game.Screens.Play
Color4 colour = State == ColumnState.Lit ? lit_colour : dimmed_colour; Color4 colour = State == ColumnState.Lit ? lit_colour : dimmed_colour;
for (int i = 0; i < drawableRows.Count; i++) for (int i = 0; i < drawableRows.Count; i++)
{
if (Filled == 0) // i <= Filled doesn't work for zero fill
{
drawableRows[i].Colour = empty_colour;
}
else
{ {
drawableRows[i].Colour = i <= Filled ? colour : empty_colour; drawableRows[i].Colour = i <= Filled ? colour : empty_colour;
} }
} }
}
public SongProgressGraphColumn() public SongProgressGraphColumn()
{ {