diff --git a/BizHawk.Client.EmuHawk/CustomControls/InputRoll/InputRoll.Drawing.cs b/BizHawk.Client.EmuHawk/CustomControls/InputRoll/InputRoll.Drawing.cs index 40bc9b4a7c..fc15de14d2 100644 --- a/BizHawk.Client.EmuHawk/CustomControls/InputRoll/InputRoll.Drawing.cs +++ b/BizHawk.Client.EmuHawk/CustomControls/InputRoll/InputRoll.Drawing.cs @@ -35,9 +35,10 @@ namespace BizHawk.Client.EmuHawk .ToList(); } - // TODO: FirstVisibleRow assumes there is a visible row - var firstVisibleRow = FirstVisibleRow; - var visibleRows = CalcVisibleRows(e.ClipRectangle); + var firstVisibleRow = Math.Max(FirstVisibleRow, 0); + var visibleRows = HorizontalOrientation + ? e.ClipRectangle.Width / CellWidth + : e.ClipRectangle.Height / CellHeight; var lastVisibleRow = firstVisibleRow + visibleRows; diff --git a/BizHawk.Client.EmuHawk/CustomControls/InputRoll/InputRoll.cs b/BizHawk.Client.EmuHawk/CustomControls/InputRoll/InputRoll.cs index abbbdbe0d7..b5c1245710 100644 --- a/BizHawk.Client.EmuHawk/CustomControls/InputRoll/InputRoll.cs +++ b/BizHawk.Client.EmuHawk/CustomControls/InputRoll/InputRoll.cs @@ -277,7 +277,6 @@ namespace BizHawk.Client.EmuHawk public void Redraw() { - // TODO: horizontal orientation if (HorizontalOrientation) { int x = MaxColumnWidth; @@ -805,17 +804,6 @@ namespace BizHawk.Client.EmuHawk } } - // TODO: don't duplicate property logic - private int CalcVisibleRows(Rectangle rect) - { - if (HorizontalOrientation) - { - return rect.Width / CellWidth; - } - - return rect.Height / CellHeight; // Minus three makes it work - } - private Cell _draggingCell; public void DragCurrentCell()