inputroll - fix crash when resized to 0

This commit is contained in:
adelikat 2019-10-26 14:37:42 -05:00
parent f6b0fa1550
commit 064a78d7f3
1 changed files with 9 additions and 0 deletions

View File

@ -1665,10 +1665,19 @@ namespace BizHawk.Client.EmuHawk
if (HorizontalOrientation)
{
_vBar.Maximum = ((columns.Count() * CellHeight) - DrawHeight) + _vBar.LargeChange;
if (_vBar.Maximum < 0)
{
_vBar.Maximum = 0;
}
}
else
{
_vBar.Maximum = RowsToPixels(RowCount + 1) - (CellHeight * 3) + _vBar.LargeChange - 1;
if (_vBar.Maximum < 0)
{
_vBar.Maximum = 0;
}
}
_vBar.Location = new Point(Width - _vBar.Width, 0);