diff options
| author | jpbruyere <jp.bruyere@hotmail.com> | 2016-03-01 12:54:52 +0100 |
|---|---|---|
| committer | jpbruyere <jp.bruyere@hotmail.com> | 2016-03-01 13:12:28 +0100 |
| commit | c5d7f03194daf5ad0931dcc13a90fd0ab564434f (patch) | |
| tree | 2cddfd897121bc67317d4f310b165c24c0c8e132 /src/GraphicObjects/GraphicObject.cs | |
| parent | a4e0b9b3b751e85f97419d5baac55d52435e6e9c (diff) | |
first tests with Interface update in a separate thread
Diffstat (limited to 'src/GraphicObjects/GraphicObject.cs')
| -rw-r--r-- | src/GraphicObjects/GraphicObject.cs | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/src/GraphicObjects/GraphicObject.cs b/src/GraphicObjects/GraphicObject.cs index b9fc6c3e..2bce3349 100644 --- a/src/GraphicObjects/GraphicObject.cs +++ b/src/GraphicObjects/GraphicObject.cs @@ -646,7 +646,8 @@ namespace Crow return; if (Interface.CurrentInterface == null) return; - Interface.CurrentInterface.gobjsToRedraw.Add (this); + lock(Interface.CurrentInterface.RenderMutex) + Interface.CurrentInterface.gobjsToRedraw.Add (this); IsQueuedForRedraw = true; } @@ -690,17 +691,19 @@ namespace Crow Debug.WriteLine ("REGLayout => {1}->{0}", layoutType, this.ToString()); #endif - //enqueue LQI LayoutingTypes separately - if (layoutType.HasFlag (LayoutingType.Width)) - Interface.LayoutingQueue.Enqueue (new LayoutingQueueItem (LayoutingType.Width, this)); - if (layoutType.HasFlag (LayoutingType.Height)) - Interface.LayoutingQueue.Enqueue (new LayoutingQueueItem (LayoutingType.Height, this)); - if (layoutType.HasFlag (LayoutingType.X)) - Interface.LayoutingQueue.Enqueue (new LayoutingQueueItem (LayoutingType.X, this)); - if (layoutType.HasFlag (LayoutingType.Y)) - Interface.LayoutingQueue.Enqueue (new LayoutingQueueItem (LayoutingType.Y, this)); - if (layoutType.HasFlag (LayoutingType.ArrangeChildren)) - Interface.LayoutingQueue.Enqueue (new LayoutingQueueItem (LayoutingType.ArrangeChildren, this)); + lock (Interface.LayoutingQueue) { + //enqueue LQI LayoutingTypes separately + if (layoutType.HasFlag (LayoutingType.Width)) + Interface.LayoutingQueue.Enqueue (new LayoutingQueueItem (LayoutingType.Width, this)); + if (layoutType.HasFlag (LayoutingType.Height)) + Interface.LayoutingQueue.Enqueue (new LayoutingQueueItem (LayoutingType.Height, this)); + if (layoutType.HasFlag (LayoutingType.X)) + Interface.LayoutingQueue.Enqueue (new LayoutingQueueItem (LayoutingType.X, this)); + if (layoutType.HasFlag (LayoutingType.Y)) + Interface.LayoutingQueue.Enqueue (new LayoutingQueueItem (LayoutingType.Y, this)); + if (layoutType.HasFlag (LayoutingType.ArrangeChildren)) + Interface.LayoutingQueue.Enqueue (new LayoutingQueueItem (LayoutingType.ArrangeChildren, this)); + } } /// <summary> trigger dependant sizing component update </summary> |