]> O.S.I.I.S - jp/crow.git/commitdiff
use int.MinValue as error mark while measuring object to requeue Layouting
authorjp <jp_bruyere@hotmail.com>
Tue, 19 Apr 2016 10:02:54 +0000 (12:02 +0200)
committerjp <jp_bruyere@hotmail.com>
Tue, 19 Apr 2016 10:02:54 +0000 (12:02 +0200)
src/GraphicObjects/GraphicObject.cs
src/GraphicObjects/PrivateContainer.cs

index 8877c6b235f3ccfc0b769f8c31beb630b58c8ef3..7020cc3fdc6fda9cf888d5989f440bd5785ffceb 100644 (file)
@@ -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;
index 98e8d4b1baa5c7776c25ff6d17794195d6233081..f4bc3aba28b684c715c6bec6a58a60ba6ead5b7f 100644 (file)
@@ -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)
                {