aboutsummaryrefslogtreecommitdiffstatsci
path: root/src/GraphicObjects/GenericStack.cs
diff options
context:
space:
mode:
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>2018-03-06 10:39:36 +0100
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>2018-03-06 10:39:36 +0100
commitd83f40cedf817cd5781bda9fa37534cab23b8258 (patch)
treecd4352f6c2da168a6079ad4849083847801b018f /src/GraphicObjects/GenericStack.cs
parent363b9425f0a222d728dd063f5317d97f72c9a4db (diff)
tab improvments
Diffstat (limited to 'src/GraphicObjects/GenericStack.cs')
-rw-r--r--src/GraphicObjects/GenericStack.cs10
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;