From 8f841bd580d8a1ed3fd341e83dce478d9a9ca6bb Mon Sep 17 00:00:00 2001 From: jp Date: Tue, 19 Apr 2016 12:02:54 +0200 Subject: [PATCH] use int.MinValue as error mark while measuring object to requeue Layouting --- src/GraphicObjects/GraphicObject.cs | 6 ++++++ src/GraphicObjects/PrivateContainer.cs | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/GraphicObjects/GraphicObject.cs b/src/GraphicObjects/GraphicObject.cs index 8877c6b2..7020cc3f 100644 --- a/src/GraphicObjects/GraphicObject.cs +++ b/src/GraphicObjects/GraphicObject.cs @@ -816,6 +816,9 @@ namespace Crow else Slot.Width = Parent.ClientRectangle.Width * Width / 100; + if (Slot.Width == int.MinValue) + return false; + //size constrain if (Slot.Width < MinimumSize.Width) { Slot.Width = MinimumSize.Width; @@ -846,6 +849,9 @@ namespace Crow else Slot.Height = Parent.ClientRectangle.Height * Height.Value / 100; + if (Slot.Height == int.MinValue) + return false; + //size constrain if (Slot.Height < MinimumSize.Height) { Slot.Height = MinimumSize.Height; diff --git a/src/GraphicObjects/PrivateContainer.cs b/src/GraphicObjects/PrivateContainer.cs index 98e8d4b1..f4bc3aba 100644 --- a/src/GraphicObjects/PrivateContainer.cs +++ b/src/GraphicObjects/PrivateContainer.cs @@ -96,10 +96,10 @@ namespace Crow return base.measureRawSize (lt); if (lt == LayoutingType.Width) return child.RegisteredLayoutings.HasFlag(LayoutingType.Width) ? - -1 : child.Slot.Size.Width + 2 * Margin; + int.MinValue : child.Slot.Size.Width + 2 * Margin; else return child.RegisteredLayoutings.HasFlag(LayoutingType.Height) ? - -1 : child.Slot.Size.Height + 2 * Margin; + int.MinValue : child.Slot.Size.Height + 2 * Margin; } public override bool UpdateLayout (LayoutingType layoutType) { -- 2.47.3