Fix AOoRE when loading TAStudio w/ cheats(?)

partially reverts dd4f9aaf6
InputRoll code is too inscrutable for me to determine the actual cause so I just
left a `Debug.Assert`
This commit is contained in:
YoshiRulz 2022-09-30 03:25:13 +10:00
parent d7810f6ea9
commit 9e9e041bba
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
1 changed files with 10 additions and 2 deletions

View File

@ -800,9 +800,17 @@ namespace BizHawk.Client.EmuHawk
}
}
private bool IsVisible(int index) => FirstVisibleRow.RangeTo(LastFullyVisibleRow).Contains(index);
private bool IsVisible(int index)
{
Debug.Assert(FirstVisibleRow < LastFullyVisibleRow);
return FirstVisibleRow <= index && index <= LastFullyVisibleRow;
}
public bool IsPartiallyVisible(int index) => FirstVisibleRow.RangeTo(LastVisibleRow).Contains(index);
public bool IsPartiallyVisible(int index)
{
Debug.Assert(FirstVisibleRow < LastVisibleRow);
return FirstVisibleRow <= index && index <= LastVisibleRow;
}
/// <summary>
/// Gets the number of rows currently visible including partially visible rows.