diff options
| author | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2018-03-15 17:56:20 +0100 |
|---|---|---|
| committer | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2018-03-15 17:56:20 +0100 |
| commit | dbc6b7e54c4daecfde5d2fd629d6add1fcc24f87 (patch) | |
| tree | c8180f43aa76e7e45cd7f29ceb8d036b0cead719 /src/GraphicObjects/GenericStack.cs | |
| parent | 349026b730dfa53c59f20b3b0f0f9f9feecf43a5 (diff) | |
testing with requestedLayouting field
Diffstat (limited to 'src/GraphicObjects/GenericStack.cs')
| -rw-r--r-- | src/GraphicObjects/GenericStack.cs | 10 |
1 files changed, 6 insertions, 4 deletions
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; } |