diff --git a/src/Dock.Avalonia/Controls/ProportionalStackPanel.cs b/src/Dock.Avalonia/Controls/ProportionalStackPanel.cs index a9437e33..e1a331e1 100644 --- a/src/Dock.Avalonia/Controls/ProportionalStackPanel.cs +++ b/src/Dock.Avalonia/Controls/ProportionalStackPanel.cs @@ -404,7 +404,8 @@ protected override Size ArrangeOverride(Size arrangeSize) else { Debug.Assert(!double.IsNaN(proportion)); - var width = CalculateDimension(arrangeSize.Width - splitterThickness, proportion, ref sumOfFractions); + var width = CalculateDimension(arrangeSize.Width - splitterThickness, proportion, + ref sumOfFractions); remainingRect = remainingRect.WithWidth(width); left += width; } @@ -421,7 +422,8 @@ protected override Size ArrangeOverride(Size arrangeSize) else { Debug.Assert(!double.IsNaN(proportion)); - var height = CalculateDimension(arrangeSize.Height - splitterThickness, proportion, ref sumOfFractions); + var height = CalculateDimension(arrangeSize.Height - splitterThickness, proportion, + ref sumOfFractions); remainingRect = remainingRect.WithHeight(height); top += height; } @@ -439,13 +441,13 @@ protected override Size ArrangeOverride(Size arrangeSize) } private double CalculateDimension( - double dimension, - double proportion, + double dimension, + double proportion, ref double sumOfFractions) { var childDimension = dimension * proportion; var flooredChildDimension = Math.Floor(childDimension); - + // sums fractions from the division sumOfFractions += childDimension - flooredChildDimension; @@ -455,7 +457,7 @@ private double CalculateDimension( sumOfFractions -= Math.Round(sumOfFractions); return Math.Max(0, flooredChildDimension + 1); } - + return Math.Max(0, flooredChildDimension); }