From 17440fad2f3d4a8c8d2887d61952b69a28391274 Mon Sep 17 00:00:00 2001 From: YoshiRulz Date: Sat, 12 Sep 2020 21:14:25 +1000 Subject: [PATCH] Fix crash when painting selected row backgrounds in InputRoll --- .../CustomControls/InputRoll/InputRoll.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/BizHawk.Client.EmuHawk/CustomControls/InputRoll/InputRoll.cs b/src/BizHawk.Client.EmuHawk/CustomControls/InputRoll/InputRoll.cs index 94d7854ad6..30bd526602 100644 --- a/src/BizHawk.Client.EmuHawk/CustomControls/InputRoll/InputRoll.cs +++ b/src/BizHawk.Client.EmuHawk/CustomControls/InputRoll/InputRoll.cs @@ -830,7 +830,8 @@ namespace BizHawk.Client.EmuHawk return (_drawWidth - MaxColumnWidth) / CellWidth; } - return (_drawHeight - ColumnHeight - 3) / CellHeight; // Minus three makes it work + var result = (_drawHeight - ColumnHeight - 3) / CellHeight; // Minus three makes it work + return result < 0 ? 0 : result; } }