Tastudio - tweak logic for determining which frame should be visible
This commit is contained in:
parent
d1d414d10e
commit
f78e4bb1b2
|
@ -452,6 +452,11 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
public bool IsVisible(int index)
|
||||
{
|
||||
return (index >= FirstVisibleRow) && (index <= LastVisibleRow);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the number of rows currently visible including partially visible rows.
|
||||
/// </summary>
|
||||
|
@ -465,12 +470,12 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
var width = DrawWidth - (NeedsVScrollbar ? VBar.Width : 0);
|
||||
|
||||
return (int)Math.Floor((decimal)(width - ColumnWidth) / CellWidth);
|
||||
return (int)((width - ColumnWidth) / CellWidth);
|
||||
}
|
||||
|
||||
var height = DrawHeight - (NeedsHScrollbar ? HBar.Height : 0);
|
||||
|
||||
return (int)((decimal)height / CellHeight);
|
||||
return (int)height / CellHeight;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -5,6 +5,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
public partial class TAStudio : IToolForm
|
||||
{
|
||||
public bool UpdateBefore { get { return false; } }
|
||||
|
||||
public void UpdateValues()
|
||||
{
|
||||
if (!IsHandleCreated || IsDisposed || _currentTasMovie == null)
|
||||
|
@ -12,15 +14,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
return;
|
||||
}
|
||||
|
||||
if (_currentTasMovie.IsRecording)
|
||||
{
|
||||
TasView.LastVisibleRow = _currentTasMovie.InputLogLength - 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
TasView.LastVisibleRow = Global.Emulator.Frame;
|
||||
}
|
||||
|
||||
SetVisibleIndex();
|
||||
RefreshDialog();
|
||||
}
|
||||
|
||||
|
@ -31,14 +25,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
return;
|
||||
}
|
||||
|
||||
if (_currentTasMovie.IsRecording)
|
||||
{
|
||||
TasView.LastVisibleRow = _currentTasMovie.InputLogLength - 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
TasView.LastVisibleRow = Global.Emulator.Frame;
|
||||
}
|
||||
SetVisibleIndex();
|
||||
}
|
||||
|
||||
public void Restart()
|
||||
|
@ -86,6 +73,16 @@ namespace BizHawk.Client.EmuHawk
|
|||
return true;
|
||||
}
|
||||
|
||||
public bool UpdateBefore { get { return false; } }
|
||||
private void SetVisibleIndex()
|
||||
{
|
||||
int indexThatMustBeVisible = _currentTasMovie.IsRecording
|
||||
? _currentTasMovie.InputLogLength
|
||||
: Global.Emulator.Frame + 1;
|
||||
|
||||
if (!TasView.IsVisible(indexThatMustBeVisible))
|
||||
{
|
||||
TasView.LastVisibleRow = indexThatMustBeVisible;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue