]> O.S.I.I.S - jp/crow.git/commitdiff
test already registeredLayouting at the beginning of RegisterForLayouting
authorjpbruyere <jp.bruyere@hotmail.com>
Tue, 13 Sep 2016 09:55:49 +0000 (11:55 +0200)
committerjpbruyere <jp.bruyere@hotmail.com>
Tue, 13 Sep 2016 09:55:49 +0000 (11:55 +0200)
src/GraphicObjects/GraphicObject.cs

index ffa2d4809b2767aec38b0e85c0d9dd455ae87110..093664d11a16573e8b9584bd69a9ed5667095f29 100644 (file)
@@ -729,7 +729,7 @@ namespace Crow
                public void RegisterForGraphicUpdate ()
                {
                        bmp = null;
-                       if (Width == Measure.Fit || Height == Measure.Fit)
+                       if (Width.IsFit || Height.IsFit)
                                RegisterForLayouting (LayoutingType.Sizing);
                        else if (RegisteredLayoutings == LayoutingType.None)
                                CurrentInterface.EnqueueForRepaint (this);
@@ -759,6 +759,11 @@ namespace Crow
                        if (Parent == null)
                                return;
                        lock (CurrentInterface.LayoutMutex) {
+                               //prevent queueing same LayoutingType for this
+                               layoutType &= (~RegisteredLayoutings);
+
+                               if (layoutType == LayoutingType.None)
+                                       return;
                                //dont set position for stretched item
                                if (Width == Measure.Stretched)
                                        layoutType &= (~LayoutingType.X);
@@ -772,8 +777,8 @@ namespace Crow
                                if (Parent is GraphicObject)
                                        (Parent as GraphicObject).ChildrenLayoutingConstraints (ref layoutType);
 
-                               //prevent queueing same LayoutingType for this
-                               layoutType &= (~RegisteredLayoutings);
+//                             //prevent queueing same LayoutingType for this
+//                             layoutType &= (~RegisteredLayoutings);
 
                                if (layoutType == LayoutingType.None)
                                        return;