This commit is contained in:
adelikat 2019-12-07 09:43:50 -06:00
parent d8f0dca586
commit 0d2770044a
2 changed files with 4 additions and 15 deletions

View File

@ -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;

View File

@ -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()