From 975df273eafe358482d892c108fbba1fdc5cac1f Mon Sep 17 00:00:00 2001 From: Jean-Philippe Bruyère Date: Tue, 6 Mar 2018 10:39:36 +0100 Subject: tab improvments --- src/GraphicObjects/GenericStack.cs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src/GraphicObjects/GenericStack.cs') diff --git a/src/GraphicObjects/GenericStack.cs b/src/GraphicObjects/GenericStack.cs index 19c70076..f23b0bba 100644 --- a/src/GraphicObjects/GenericStack.cs +++ b/src/GraphicObjects/GenericStack.cs @@ -28,6 +28,7 @@ using System.ComponentModel; using System.Diagnostics; using System.Xml.Serialization; using System; +using System.Linq; namespace Crow { @@ -79,13 +80,8 @@ namespace Crow } protected override int measureRawSize (LayoutingType lt) { - int totSpace = 0; - for (int i = 0; i < Children.Count; i++) { - if (Children [i].Visible) - totSpace += Spacing; - } - if (totSpace > 0) - totSpace -= Spacing; + int totSpace = Spacing * (Children.Count (c => c.Visible) - 1); + if (lt == LayoutingType.Width) { if (Orientation == Orientation.Horizontal) return contentSize.Width + totSpace + 2 * Margin; -- cgit v1.3.1-4-g156e