From: jpbruyere Date: Tue, 13 Sep 2016 09:55:49 +0000 (+0200) Subject: test already registeredLayouting at the beginning of RegisterForLayouting X-Git-Tag: v0.9.5-beta~259^2~27 X-Git-Url: https://git.osiis.dedyn.io/?a=commitdiff_plain;h=10554f8a78a6981f5e49e46a32b3eee5911b872e;p=jp%2Fcrow.git test already registeredLayouting at the beginning of RegisterForLayouting --- 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;