From 72f58bc69dc8c7a846df5151e7dffeb0c0f0ec0a Mon Sep 17 00:00:00 2001 From: adelikat Date: Sat, 23 Aug 2014 12:30:21 +0000 Subject: [PATCH] Input Roll - horizontal scrolling in Horizontal Orientation --- .../tools/TAStudio/InputRoll.cs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/InputRoll.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/InputRoll.cs index 7609f5b724..2bf9a1a7e5 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/InputRoll.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/InputRoll.cs @@ -374,14 +374,17 @@ namespace BizHawk.Client.EmuHawk { if (HorizontalOrientation) { - var visibleRows = ((Width - _horizontalOrientedColumnWidth) / CellWidth) + 1; - if (visibleRows >= ItemCount) + int startIndex = NeedsHScrollbar ? HBar.Value : 0; + int endIndex = startIndex + (Width / CellWidth); + if (endIndex >= ItemCount) { - visibleRows = ItemCount; + endIndex = ItemCount; } + int range = endIndex - startIndex; + Gdi.PrepDrawString(this.Font, this.ForeColor); - for (int i = 0; i < visibleRows; i++) + for (int i = 0; i < range; i++) { for (int j = 0; j < Columns.Count; j++) { @@ -389,14 +392,14 @@ namespace BizHawk.Client.EmuHawk int x = _horizontalOrientedColumnWidth + CellPadding + (CellWidth * i); int y = j * CellHeight; var point = new Point(x, y); - QueryItemText(i, j, out text); + QueryItemText(i + startIndex, j, out text); Gdi.DrawString(text, point); } } } else { - int startIndex = VBar.Value; + int startIndex = NeedsVScrollbar ? VBar.Value : 0; int endIndex = startIndex + (Height / CellHeight); if (endIndex >= ItemCount)