From ecc2ebe1571d05746ba262fec231d007a0f21ff7 Mon Sep 17 00:00:00 2001 From: jpbruyere Date: Tue, 13 Sep 2016 11:55:49 +0200 Subject: [PATCH] test already registeredLayouting at the beginning of RegisterForLayouting --- src/GraphicObjects/GraphicObject.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/GraphicObjects/GraphicObject.cs b/src/GraphicObjects/GraphicObject.cs index ffa2d480..093664d1 100644 --- a/src/GraphicObjects/GraphicObject.cs +++ b/src/GraphicObjects/GraphicObject.cs @@ -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; -- 2.47.3