diff options
| author | jpbruyere <jp.bruyere@hotmail.com> | 2016-02-07 15:44:25 +0100 |
|---|---|---|
| committer | jpbruyere <jp.bruyere@hotmail.com> | 2016-02-07 15:44:25 +0100 |
| commit | 46f593f8d2a9c76b582720e0a44af3075f879a93 (patch) | |
| tree | d24a6665d92bd4fe91ec7a8d34dc3206fc18f8c5 /src | |
| parent | 1c7f2d63a7230cb487faf915b9431784653f48ef (diff) | |
prevent RegisterForLayouting when parent is null, and dequeue LQI when parent of GO is null
Diffstat (limited to 'src')
| -rw-r--r-- | src/GraphicObjects/GraphicObject.cs | 4 | ||||
| -rw-r--r-- | src/LayoutingQueueItem.cs | 16 |
2 files changed, 10 insertions, 10 deletions
diff --git a/src/GraphicObjects/GraphicObject.cs b/src/GraphicObjects/GraphicObject.cs index 40f5dcf7..d04c94d7 100644 --- a/src/GraphicObjects/GraphicObject.cs +++ b/src/GraphicObjects/GraphicObject.cs @@ -386,7 +386,7 @@ namespace Crow get { return _maximumSize; } set { _maximumSize = value; } } - [XmlAttributeAttribute()][DefaultValue("0;0")] + [XmlAttributeAttribute()][DefaultValue("1;1")] public virtual Size MinimumSize { get { return _minimumSize; } set { _minimumSize = value; } @@ -503,6 +503,8 @@ namespace Crow } public virtual void RegisterForLayouting(LayoutingType layoutType){ + if (Parent == null) + return; //dont set position for stretched item if (Width == 0) layoutType &= (~LayoutingType.X); diff --git a/src/LayoutingQueueItem.cs b/src/LayoutingQueueItem.cs index d5ad7fcc..ef787d35 100644 --- a/src/LayoutingQueueItem.cs +++ b/src/LayoutingQueueItem.cs @@ -55,16 +55,14 @@ namespace Crow Debug.WriteLine ("Layouting => " + this.ToString ()); #endif - try { - if (GraphicObject.Parent == null){ - Debug.WriteLine("ERROR: processLayouting, no parent for: " + GraphicObject.ToString()); - return; - } - if (!GraphicObject.UpdateLayout (LayoutType)) - Interface.LayoutingQueue.Enqueue(this); - } catch (Exception ex) { - Debug.WriteLine ("Layouting error: " + ex.ToString ()); + if (GraphicObject.Parent == null) { + //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 ()); + return; } + if (!GraphicObject.UpdateLayout (LayoutType)) + Interface.LayoutingQueue.Enqueue(this); } public static implicit operator GraphicObject(LayoutingQueueItem queueItem) |