diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/InputRoll.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/InputRoll.cs index 0130d755c5..602c0b8d8a 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/InputRoll.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/InputRoll.cs @@ -743,12 +743,21 @@ namespace BizHawk.Client.EmuHawk { if (HorizontalOrientation) { - for (int i = 0; i < VisibleRows; i++) + int startIndex = NeedsHScrollbar ? HBar.Value : 0; + int endIndex = startIndex + (Width / CellWidth); + if (endIndex >= ItemCount) + { + endIndex = ItemCount; + } + + int range = endIndex - startIndex; + + for (int i = 0; i < range; i++) { for (int j = 0; j < _columns.Count; j++) { Color color = Color.White; - QueryItemBkColor(i, j, ref color); + QueryItemBkColor(i + startIndex, j, ref color); // TODO: refactor to use DrawCellBG if (color != Color.White) // An easy optimization, don't draw unless the user specified something other than the default @@ -765,19 +774,29 @@ namespace BizHawk.Client.EmuHawk } else { - for (int i = 1; i < VisibleRows; i++) + int startIndex = NeedsVScrollbar ? VBar.Value : 0; + int endIndex = startIndex + (Height / CellHeight); + + if (endIndex >= ItemCount) + { + endIndex = ItemCount; + } + + int range = endIndex - startIndex; + + for (int i = 0; i < range; i++) { int x = 1; for (int j = 0; j < _columns.Count; j++) { Color color = Color.White; - QueryItemBkColor(i, j, ref color); + QueryItemBkColor(i + startIndex, j, ref color); var width = CalcWidth(_columns[j]); if (color != Color.White) // An easy optimization, don't draw unless the user specified something other than the default { Gdi.SetBrush(color); - Gdi.FillRectangle(x, (i * CellHeight) + 2, width - 1, CellHeight - 1); + Gdi.FillRectangle(x, ((i + 1) * CellHeight) + 2, width - 1, CellHeight - 1); } x += width; diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/MarkerControl.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/MarkerControl.cs index 89d0290b3e..25e21aea0b 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/MarkerControl.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/MarkerControl.cs @@ -44,12 +44,6 @@ namespace BizHawk.Client.EmuHawk } - public void UpdateValues() - { - MarkerView.ItemCount = Tastudio.CurrentMovie.Markers.Count; - MarkerView.Refresh(); - } - private void MarkerView_QueryItemBkColor(int index, int column, ref Color color) { var prev = Markers.PreviousOrCurrent(Global.Emulator.Frame); @@ -100,14 +94,14 @@ namespace BizHawk.Client.EmuHawk MarkerView_SelectedIndexChanged(sender, e); } - public new void Refresh() + public void UpdateValues() { if (MarkerView != null && Markers != null) { MarkerView.ItemCount = Markers.Count; } - base.Refresh(); + MarkerView.Refresh(); } private void MarkerView_SelectedIndexChanged(object sender, EventArgs e) diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs index 53b0533a57..1fc73302e4 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs @@ -157,7 +157,7 @@ namespace BizHawk.Client.EmuHawk if (MarkerControl != null) { - MarkerControl.Refresh(); + MarkerControl.UpdateValues(); } } @@ -385,7 +385,7 @@ namespace BizHawk.Client.EmuHawk if (result == DialogResult.OK) { _currentTasMovie.Markers.Add(markerFrame, i.PromptText); - MarkerControl.Refresh(); + MarkerControl.UpdateValues(); } }