From eb5a354d624f49f4a82f0574a9d4b604db0acf4f Mon Sep 17 00:00:00 2001 From: Dan Walmsley Date: Wed, 4 Oct 2017 13:13:07 +0100 Subject: [PATCH] [StackPanel] Gap value is not added to the measured width or height after the last child. --- src/Avalonia.Controls/StackPanel.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Avalonia.Controls/StackPanel.cs b/src/Avalonia.Controls/StackPanel.cs index 0e12fb3283..a6fe35d668 100644 --- a/src/Avalonia.Controls/StackPanel.cs +++ b/src/Avalonia.Controls/StackPanel.cs @@ -170,6 +170,15 @@ namespace Avalonia.Controls } } + if (Orientation == Orientation.Vertical) + { + measuredHeight -= gap; + } + else + { + measuredWidth -= gap; + } + return new Size(measuredWidth, measuredHeight); }