From dbc6b7e54c4daecfde5d2fd629d6add1fcc24f87 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Bruyère Date: Thu, 15 Mar 2018 17:56:20 +0100 Subject: testing with requestedLayouting field --- src/GraphicObjects/GenericStack.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/GraphicObjects/GenericStack.cs') diff --git a/src/GraphicObjects/GenericStack.cs b/src/GraphicObjects/GenericStack.cs index 64841d4b..7f452cb0 100644 --- a/src/GraphicObjects/GenericStack.cs +++ b/src/GraphicObjects/GenericStack.cs @@ -78,9 +78,11 @@ namespace Crow else layoutType &= (~LayoutingType.Y); } - protected override int measureRawSize (LayoutingType lt) + protected override int measureRawSize(LayoutingType lt) { + childrenRWLock.EnterReadLock (); int totSpace = Math.Max(0, Spacing * (Children.Count (c => c.Visible) - 1)); + childrenRWLock.ExitReadLock (); if (lt == LayoutingType.Width) { if (Orientation == Orientation.Horizontal) return contentSize.Width + totSpace + 2 * Margin; @@ -92,6 +94,7 @@ namespace Crow public virtual void ComputeChildrenPositions() { int d = 0; + childrenRWLock.EnterReadLock (); if (Orientation == Orientation.Horizontal) { foreach (GraphicObject c in Children) { if (!c.Visible) @@ -107,6 +110,7 @@ namespace Crow d += c.Slot.Height + Spacing; } } + childrenRWLock.ExitReadLock (); IsDirty = true; } GraphicObject stretchedGO = null; @@ -121,9 +125,7 @@ namespace Crow //in the direction of stacking. ComputeChildrenPositions (); - //if no layouting remains in queue for item, registre for redraw - if (RegisteredLayoutings == LayoutingType.None && IsDirty) - IFace.EnqueueForRepaint (this); + EnqueueForRepaint(); return true; } -- cgit v1.3.1-4-g156e