@@ -483,14 +483,14 @@ protected override void InternalArrange()
483
483
var availableSize = bounds . Size ( ) ;
484
484
var oldMeasureSize = InternalChild . Measure ( availableSize ) ;
485
485
486
- _horizontalScrollingOn = oldMeasureSize . X > bounds . Width ;
487
- _verticalScrollingOn = oldMeasureSize . Y > bounds . Height ;
486
+ _horizontalScrollingOn = ( oldMeasureSize . X > bounds . Width ) && ShowHorizontalScrollBar ;
487
+ _verticalScrollingOn = ( oldMeasureSize . Y > bounds . Height ) && ShowVerticalScrollBar ;
488
488
if ( _horizontalScrollingOn || _verticalScrollingOn )
489
489
{
490
490
var vsWidth = VerticalScrollbarWidth ;
491
491
var hsHeight = HorizontalScrollbarHeight ;
492
492
493
- if ( _horizontalScrollingOn && ShowHorizontalScrollBar )
493
+ if ( _horizontalScrollingOn )
494
494
{
495
495
availableSize . Y -= hsHeight ;
496
496
@@ -500,7 +500,7 @@ protected override void InternalArrange()
500
500
}
501
501
}
502
502
503
- if ( _verticalScrollingOn && ShowVerticalScrollBar )
503
+ if ( _verticalScrollingOn )
504
504
{
505
505
availableSize . X -= vsWidth ;
506
506
@@ -512,7 +512,7 @@ protected override void InternalArrange()
512
512
513
513
// Remeasure with scrollbars
514
514
var measureSize = InternalChild . Measure ( availableSize ) ;
515
- var bw = bounds . Width - ( _verticalScrollingOn && ShowVerticalScrollBar ? vsWidth : 0 ) ;
515
+ var bw = bounds . Width - ( _verticalScrollingOn ? vsWidth : 0 ) ;
516
516
517
517
_horizontalScrollbarFrame = new Rectangle ( bounds . Left ,
518
518
bounds . Bottom - hsHeight ,
@@ -563,31 +563,15 @@ protected override void InternalArrange()
563
563
_thumbMaximumY = 1 ;
564
564
}
565
565
566
- if ( _horizontalScrollingOn && ShowHorizontalScrollBar )
566
+ if ( _horizontalScrollingOn )
567
567
{
568
568
bounds . Width = measureSize . X ;
569
569
}
570
- else if ( _horizontalScrollingOn )
571
- {
572
- bounds . Width = oldMeasureSize . X ;
573
- }
574
- else
575
- {
576
- bounds . Width = availableSize . X ;
577
- }
578
570
579
- if ( _verticalScrollingOn && ShowVerticalScrollBar )
571
+ if ( _verticalScrollingOn )
580
572
{
581
573
bounds . Height = measureSize . Y ;
582
574
}
583
- else if ( _verticalScrollingOn )
584
- {
585
- bounds . Height = oldMeasureSize . Y ;
586
- }
587
- else
588
- {
589
- bounds . Height = availableSize . Y ;
590
- }
591
575
}
592
576
593
577
InternalChild . Arrange ( bounds ) ;
0 commit comments