From 3a4351c4ea6e5f9effff383f45495a0a9be116d9 Mon Sep 17 00:00:00 2001 From: adelikat Date: Tue, 3 Dec 2019 14:22:21 -0600 Subject: [PATCH] InputRoll - cleanup --- .../CustomControls/InputRoll/InputRoll.Drawing.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/BizHawk.Client.EmuHawk/CustomControls/InputRoll/InputRoll.Drawing.cs b/BizHawk.Client.EmuHawk/CustomControls/InputRoll/InputRoll.Drawing.cs index 785e0120f5..6c2acbb741 100644 --- a/BizHawk.Client.EmuHawk/CustomControls/InputRoll/InputRoll.Drawing.cs +++ b/BizHawk.Client.EmuHawk/CustomControls/InputRoll/InputRoll.Drawing.cs @@ -493,18 +493,19 @@ namespace BizHawk.Client.EmuHawk private void DoSelectionBG(List visibleColumns) { Color rowColor = Color.White; + int firstVisibleRow = FirstVisibleRow; int lastVisibleRow = LastVisibleRow; int lastRow = -1; foreach (Cell cell in _selectedItems) { - if (cell.RowIndex > lastVisibleRow || cell.RowIndex < FirstVisibleRow || !VisibleColumns.Contains(cell.Column)) + if (!cell.RowIndex.HasValue || cell.RowIndex > lastVisibleRow || cell.RowIndex < firstVisibleRow || !VisibleColumns.Contains(cell.Column)) { continue; } Cell relativeCell = new Cell { - RowIndex = cell.RowIndex - FirstVisibleRow, + RowIndex = cell.RowIndex - firstVisibleRow, Column = cell.Column, }; relativeCell.RowIndex -= CountLagFramesAbsolute(relativeCell.RowIndex.Value);