aboutsummaryrefslogtreecommitdiffstatsci
diff options
context:
space:
mode:
authorjp <jp_bruyere@hotmail.com>2016-04-19 12:02:54 +0200
committerjp <jp_bruyere@hotmail.com>2016-04-19 12:02:54 +0200
commit8f841bd580d8a1ed3fd341e83dce478d9a9ca6bb (patch)
treee9063d2a8534915ffc3af7eda946ad9afe1e6d7b
parente99931681315513110cd7be2053c1e51e14c08c1 (diff)
use int.MinValue as error mark while measuring object to requeue Layouting
-rw-r--r--src/GraphicObjects/GraphicObject.cs6
-rw-r--r--src/GraphicObjects/PrivateContainer.cs4
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)
{