]> O.S.I.I.S - jp/crow.git/commitdiff
debug stack sizing with linq returning neg value
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Wed, 7 Mar 2018 15:05:51 +0000 (16:05 +0100)
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Wed, 7 Mar 2018 15:05:51 +0000 (16:05 +0100)
src/GraphicObjects/GenericStack.cs

index 587f86dc5a4afd9e6b91cbb32d266fb03a21843d..181c41c29e2e1e47c540a24ad8ec7e3d9ec68e2b 100644 (file)
@@ -80,8 +80,7 @@ namespace Crow
                }
                protected override int measureRawSize (LayoutingType lt)
                {
-                       int totSpace = Spacing * (Children.Count (c => c.Visible) - 1);
-
+                       int totSpace = Math.Max(0, Spacing * (Children.Count (c => c.Visible) - 1));
                        if (lt == LayoutingType.Width) {
                                if (Orientation == Orientation.Horizontal)
                                        return contentSize.Width + totSpace + 2 * Margin;