]> O.S.I.I.S - jp/crow.git/commitdiff
put test LayoutingType.None outside Stack test
authorjpbruyere <jp.bruyere@hotmail.com>
Sat, 6 Feb 2016 13:11:08 +0000 (14:11 +0100)
committerjpbruyere <jp.bruyere@hotmail.com>
Sat, 6 Feb 2016 13:12:05 +0000 (14:12 +0100)
src/GraphicObjects/GraphicObject.cs

index e2ddf126d44d0da4cffceed0d2701498507e8e47..1f437021be6115e982feb911605ecfe46ee91908 100644 (file)
@@ -512,6 +512,10 @@ namespace Crow
                public LayoutingType RegisteredLayoutings = 0;
 
                public virtual void RegisterForLayouting(LayoutingType layoutType){
+                       if (Width == 0)
+                               layoutType &= (~LayoutingType.X);
+                       if (Height == 0)
+                               layoutType &= (~LayoutingType.Y);
                        //Prevent child repositionning in a stack
                        //TODO:this should be done inside GenericStack
                        GenericStack gs = Parent as GenericStack;
@@ -520,11 +524,9 @@ namespace Crow
                                        layoutType &= (~LayoutingType.X);
                                else
                                        layoutType &= (~LayoutingType.Y);
-
-                               if (layoutType == LayoutingType.None)
-                                       return;
                        }
-
+                       if (layoutType == LayoutingType.None)
+                               return;
                        if (RegisteredLayoutings == LayoutingType.None)
                                Interface.RegisteredGOForLayouting.Enqueue (this);
                        RegisteredLayoutings |= (LayoutingType)layoutType;