More cleanup

This commit is contained in:
DrabWeb
2017-03-23 23:38:23 -03:00
parent 0a11d035fe
commit b56fb310bf
3 changed files with 9 additions and 15 deletions

View File

@ -16,7 +16,6 @@ namespace osu.Game.Screens.Play
public class SongProgressGraph : BufferedContainer
{
private Column[] columns = { };
private float lastDrawWidth;
public int ColumnCount => columns.Length;
@ -54,6 +53,7 @@ namespace osu.Game.Screens.Play
PixelSnapping = true;
}
private float lastDrawWidth;
protected override void Update()
{
base.Update();
@ -98,9 +98,7 @@ namespace osu.Game.Screens.Play
if (values == null)
{
for (float i = 0; i < ColumnCount; i++)
{
newValues.Add(0);
}
return;
}
@ -192,10 +190,10 @@ namespace osu.Game.Screens.Play
Size = new Vector2(cube_size),
Position = new Vector2(0, r * WIDTH + padding),
});
Add(drawableRows[drawableRows.Count - 1]);
}
Children = drawableRows;
// Reverse drawableRows so when iterating through them they start at the bottom
drawableRows.Reverse();
}
@ -207,13 +205,9 @@ namespace osu.Game.Screens.Play
for (int i = 0; i < drawableRows.Count; i++)
{
if (Filled == 0) // i <= Filled doesn't work for zero fill
{
drawableRows[i].Colour = emptyColour;
}
else
{
drawableRows[i].Colour = i <= Filled ? colour : emptyColour;
}
}
}
}