Skip to content

Commit 5c0c2b6

Browse files
committed
make input roll scroll bars visible even when the whole input roll is not
1 parent 84d2f3a commit 5c0c2b6

2 files changed

Lines changed: 17 additions & 2 deletions

File tree

src/BizHawk.Client.EmuHawk/CustomControls/InputRoll/InputRoll.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1742,7 +1742,6 @@ private void RecalculateScrollBars()
17421742
}
17431743
}
17441744

1745-
_vBar.Location = new Point(Width - _vBar.Width, 0);
17461745
_vBar.Height = Height;
17471746
_vBar.Visible = true;
17481747
}
@@ -1764,7 +1763,6 @@ private void RecalculateScrollBars()
17641763
_hBar.Maximum = TotalColWidth - _drawWidth + _hBar.LargeChange;
17651764
}
17661765

1767-
_hBar.Location = new Point(0, Height - _hBar.Height);
17681766
_hBar.Width = Width - (NeedsVScrollbar ? (_vBar.Width + 1) : 0);
17691767
_hBar.Visible = true;
17701768
}
@@ -1773,6 +1771,17 @@ private void RecalculateScrollBars()
17731771
_hBar.Visible = false;
17741772
_hBar.Value = 0;
17751773
}
1774+
1775+
RepositionScrollbars();
1776+
}
1777+
1778+
public void RepositionScrollbars()
1779+
{
1780+
int edge = Parent != null ? Math.Min(Width, Parent.Width - Left) : Width;
1781+
_vBar.Location = new Point(Math.Max(edge - _vBar.Width, 0), 0);
1782+
1783+
edge = Parent != null ? Math.Min(Height, Parent.Height - Top) : Height;
1784+
_hBar.Location = new Point(0, Math.Max(edge - _hBar.Height, 0));
17761785
}
17771786

17781787
private void UpdateDrawSize()

src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.ListView.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@ private void RepositionRolls()
243243
int y = margin;
244244
for (int i = 0; i < _inputRolls.Count; i++)
245245
{
246+
_inputRolls[i].SuspendDrawing();
246247
_inputRolls[i].Top = y - _tasViewVBar.Value;
247248
_inputRolls[i].Height = _inputRolls[i].TotalColWidth + 1 + _tasViewHBar.Height;
248249

@@ -263,6 +264,8 @@ private void RepositionRolls()
263264
{
264265
roll.Width = _tasViewPanel.Width - (_tasViewVBar.Visible ? _tasViewVBar.Width : 0);
265266
roll.Anchor = AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right;
267+
roll.RepositionScrollbars();
268+
roll.ResumeDrawing();
266269
roll.Refresh();
267270
}
268271

@@ -279,6 +282,7 @@ private void RepositionRolls()
279282
int x = margin;
280283
for (int i = 0; i < _inputRolls.Count; i++)
281284
{
285+
_inputRolls[i].SuspendDrawing();
282286
_inputRolls[i].Left = x - _tasViewHBar.Value;
283287
_inputRolls[i].Width = _inputRolls[i].TotalColWidth + 1 + _tasViewVBar.Width;
284288

@@ -299,6 +303,8 @@ private void RepositionRolls()
299303
{
300304
roll.Height = _tasViewPanel.Height - (_tasViewHBar.Visible ? _tasViewHBar.Height : 0);
301305
roll.Anchor = AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom;
306+
roll.RepositionScrollbars();
307+
roll.ResumeDrawing();
302308
roll.Refresh();
303309
}
304310

0 commit comments

Comments
 (0)