diff options
| author | jpbruyere <jp.bruyere@hotmail.com> | 2016-08-04 15:45:02 +0200 |
|---|---|---|
| committer | jpbruyere <jp.bruyere@hotmail.com> | 2016-08-04 15:45:02 +0200 |
| commit | e2d351c9de4ee9c8b04376228f3ab5b9310392c9 (patch) | |
| tree | c6071ae81222ee037aa14c4e762e3e16c43826ff /src/LayoutingQueueItem.cs | |
| parent | 3a01c455e09af25109239ab7ca32e66ea1ebc99b (diff) | |
Set regLayout.ALL to new object to prevent queuing in layout or
drawing, set to regLayout.None just before adding parent
LayoutingTries moved into LQI
Diffstat (limited to 'src/LayoutingQueueItem.cs')
| -rw-r--r-- | src/LayoutingQueueItem.cs | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/LayoutingQueueItem.cs b/src/LayoutingQueueItem.cs index 82673444..8ffb7dbf 100644 --- a/src/LayoutingQueueItem.cs +++ b/src/LayoutingQueueItem.cs @@ -45,6 +45,8 @@ namespace Crow public ILayoutable GraphicObject; /// <summary> Bitfield containing the element of the layout to performs (x|y|width|height)</summary> public LayoutingType LayoutType; + /// <summary> Unsuccessfull UpdateLayout and requeueing count </summary> + public int LayoutingTries; #region CTOR public LayoutingQueueItem (LayoutingType _layoutType, ILayoutable _graphicObject) @@ -58,7 +60,7 @@ namespace Crow public void ProcessLayouting() { - if (GraphicObject.Parent == null) { + if (GraphicObject.Parent == null) {//TODO:improve this //cancel layouting for object without parent, maybe some were in queue when //removed from a listbox Debug.WriteLine ("ERROR: processLayouting, no parent for: " + this.ToString ()); @@ -71,14 +73,13 @@ namespace Crow #if DEBUG_LAYOUTING Debug.WriteLine ("\tRequeuing => " + this.ToString ()); #endif - GraphicObject.LayoutingTries ++; - if (GraphicObject.LayoutingTries < Interface.MaxLayoutingTries) { + LayoutingTries ++; + if (LayoutingTries < Interface.MaxLayoutingTries) { GraphicObject.RegisteredLayoutings |= LayoutType; Interface.CurrentInterface.LayoutingQueue.Enqueue (this); } - } else { - GraphicObject.LayoutingTries = 0; - } + } else + LayoutingTries = 0; } public static implicit operator GraphicObject(LayoutingQueueItem queueItem) |