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
commit975df273eafe358482d892c108fbba1fdc5cac1f (patch)
treec55b31151da9f92b52fd52885d52a4f8442ef3be /src/GraphicObjects/GenericStack.cs
parent3726ed97fabc1d4614ef2adc5592d21ef1147e9f (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;