From 895f458fa9b5fb23c6c86389cee8abad3e8fe677 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wies=C5=82aw=20=C5=A0olt=C3=A9s?= Date: Mon, 10 Jun 2019 22:20:21 +0200 Subject: [PATCH] Update StackPanel.cs --- src/Avalonia.Controls/StackPanel.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Avalonia.Controls/StackPanel.cs b/src/Avalonia.Controls/StackPanel.cs index 0a64096ee9..c2f36b94d7 100644 --- a/src/Avalonia.Controls/StackPanel.cs +++ b/src/Avalonia.Controls/StackPanel.cs @@ -157,13 +157,13 @@ namespace Avalonia.Controls /// Children in this dimension are encouraged to be as large as they like. In the other dimension, /// StackPanel will assume the maximum size of its children. /// - /// Constraint + /// Constraint /// Desired size - protected override Size MeasureOverride(Size constraint) + protected override Size MeasureOverride(Size availableSize) { Size stackDesiredSize = new Size(); var children = Children; - Size layoutSlotSize = constraint; + Size layoutSlotSize = availableSize; bool fHorizontal = (Orientation == Orientation.Horizontal); double spacing = Spacing; bool hasVisibleChild = false; @@ -224,7 +224,7 @@ namespace Avalonia.Controls stackDesiredSize = stackDesiredSize.WithHeight(stackDesiredSize.Height - (hasVisibleChild ? spacing : 0)); } - return stackDesiredSize; + return stackDesiredSize.Constrain(availableSize); // TODO: In WPF `.Constrain(availableSize)` is not used. } ///