InputRoll - a small cleanup

This commit is contained in:
adelikat 2015-09-02 19:39:57 -04:00
parent fceb4487c9
commit dec25850c5
1 changed files with 5 additions and 10 deletions

View File

@ -539,13 +539,12 @@ namespace BizHawk.Client.EmuHawk
private void DoBackGroundCallback(PaintEventArgs e)
{
List<RollColumn> columns = _columns.VisibleColumns.ToList();
int startIndex = FirstVisibleRow;
int range = Math.Min(LastVisibleRow, RowCount - 1) - startIndex + 1;
int lastVisible = LastVisibleColumnIndex;
if (HorizontalOrientation)
{
int startIndex = FirstVisibleRow;
int range = Math.Min(LastVisibleRow, RowCount - 1) - startIndex + 1;
int lastVisible = LastVisibleColumnIndex;
for (int i = 0, f = 0; f < range; i++, f++)
{
f += lagFrames[i];
@ -587,10 +586,6 @@ namespace BizHawk.Client.EmuHawk
}
else
{
int startRow = FirstVisibleRow;
int range = Math.Min(LastVisibleRow, RowCount - 1) - startRow + 1;
int lastVisible = LastVisibleColumnIndex;
for (int i = 0, f = 0; f < range; i++, f++) // Vertical
{
f += lagFrames[i];
@ -598,13 +593,13 @@ namespace BizHawk.Client.EmuHawk
Color rowColor = Color.White;
if (QueryRowBkColor != null)
{
QueryRowBkColor(f + startRow, ref rowColor);
QueryRowBkColor(f + startIndex, ref rowColor);
}
for (int j = FirstVisibleColumn; j <= lastVisible; j++) // Horizontal
{
Color itemColor = Color.White;
QueryItemBkColor(f + startRow, columns[j], ref itemColor);
QueryItemBkColor(f + startIndex, columns[j], ref itemColor);
if (itemColor == Color.White)
{
itemColor = rowColor;