diff options
| author | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2018-03-06 10:39:36 +0100 |
|---|---|---|
| committer | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2018-03-06 10:39:36 +0100 |
| commit | 975df273eafe358482d892c108fbba1fdc5cac1f (patch) | |
| tree | c55b31151da9f92b52fd52885d52a4f8442ef3be /src/GraphicObjects/GenericStack.cs | |
| parent | 3726ed97fabc1d4614ef2adc5592d21ef1147e9f (diff) | |
tab improvments
Diffstat (limited to 'src/GraphicObjects/GenericStack.cs')
| -rw-r--r-- | src/GraphicObjects/GenericStack.cs | 10 |
1 files changed, 3 insertions, 7 deletions
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; |