From a6eee3681f08d182ea85d74ce93fbfcba15c6a8d Mon Sep 17 00:00:00 2001 From: adelikat Date: Sat, 7 Dec 2019 14:35:15 -0600 Subject: [PATCH] InputRoll - do a full refresh if rowcount gets smaller and the last row is visible --- .../CustomControls/InputRoll/InputRoll.cs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/BizHawk.Client.EmuHawk/CustomControls/InputRoll/InputRoll.cs b/BizHawk.Client.EmuHawk/CustomControls/InputRoll/InputRoll.cs index 5b0543bf0a..3caa8561e6 100644 --- a/BizHawk.Client.EmuHawk/CustomControls/InputRoll/InputRoll.cs +++ b/BizHawk.Client.EmuHawk/CustomControls/InputRoll/InputRoll.cs @@ -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) {