From: Jean-Philippe Bruyère Date: Wed, 7 Mar 2018 15:05:51 +0000 (+0100) Subject: debug stack sizing with linq returning neg value X-Git-Tag: v0.9.5-beta~153^2~17 X-Git-Url: https://git.osiis.dedyn.io/?a=commitdiff_plain;h=bdb23e49cbaa3ada4e140993796deded92f1e761;p=jp%2Fcrow.git debug stack sizing with linq returning neg value --- diff --git a/src/GraphicObjects/GenericStack.cs b/src/GraphicObjects/GenericStack.cs index 587f86dc..181c41c2 100644 --- a/src/GraphicObjects/GenericStack.cs +++ b/src/GraphicObjects/GenericStack.cs @@ -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;