File tree Expand file tree Collapse file tree
src/BizHawk.Client.EmuHawk Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ( )
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments