InputRoll - do a full refresh if rowcount gets smaller and the last row is visible

This commit is contained in:
adelikat 2019-12-07 14:35:15 -06:00
parent 1a88bfa93d
commit a6eee3681f
1 changed files with 15 additions and 2 deletions

View File

@ -261,8 +261,14 @@ namespace BizHawk.Client.EmuHawk
get => _rowCount;
set
{
bool fullRefresh = false;
if (_rowCount != value)
{
if (value < _rowCount && IsVisible(value))
{
fullRefresh = true;
}
_rowCount = value;
_selectedItems.RemoveWhere(i => i.RowIndex >= _rowCount);
RecalculateScrollBars();
@ -271,11 +277,18 @@ namespace BizHawk.Client.EmuHawk
// Similarly to ListView in virtual mode, we want to always refresh
// when setting row count, that gives the calling code assurance that
// redraw will happen
Redraw();
if (fullRefresh)
{
Refresh();
}
else
{
FastDraw();
}
}
}
public void Redraw()
private void FastDraw()
{
if (HorizontalOrientation)
{