diff --git a/ApplicationView/WidescreenPanel.cs b/ApplicationView/WidescreenPanel.cs index 0f6450599..b3bde1f18 100644 --- a/ApplicationView/WidescreenPanel.cs +++ b/ApplicationView/WidescreenPanel.cs @@ -166,19 +166,29 @@ namespace MatterHackers.MatterControl ColumnOne.Width = ColumnOneFixedWidth; //Ordering here matters - must go after children are added } + int columnTwoRequestCount = 0; void LoadColumnTwo(object state = null) { - ColumnTwo.CloseAndRemoveAllChildren(); - - UiThread.RunOnIdle((state2) => + columnTwoRequestCount++; + if (columnTwoRequestCount == 1) { - PartPreviewContent partViewContent = new PartPreviewContent(PrinterConnectionAndCommunication.Instance.ActivePrintItem, View3DWidget.WindowMode.Embeded, View3DWidget.AutoRotate.Enabled); - partViewContent.AnchorAll(); + ColumnTwo.CloseAndRemoveAllChildren(); - ColumnTwo.AddChild(partViewContent); - }); + UiThread.RunOnIdle((state2) => + { + PartPreviewContent partViewContent = new PartPreviewContent(PrinterConnectionAndCommunication.Instance.ActivePrintItem, View3DWidget.WindowMode.Embeded, View3DWidget.AutoRotate.Enabled); + partViewContent.AnchorAll(); - ColumnTwo.AnchorAll(); + ColumnTwo.AddChild(partViewContent); + columnTwoRequestCount--; + if (columnTwoRequestCount > 0) + { + UiThread.RunOnIdle(LoadColumnTwo); + } + }); + + ColumnTwo.AnchorAll(); + } } int NumberOfVisiblePanels() diff --git a/PartPreviewWindow/PartPreviewMainWindow.cs b/PartPreviewWindow/PartPreviewMainWindow.cs index 40437e399..0f6af13eb 100644 --- a/PartPreviewWindow/PartPreviewMainWindow.cs +++ b/PartPreviewWindow/PartPreviewMainWindow.cs @@ -70,20 +70,6 @@ namespace MatterHackers.MatterControl.PartPreviewWindow ShowAsSystemWindow(); } -#if __ANDROID__ - Stopwatch totalDrawTime = new Stopwatch(); - AverageMillisecondTimer millisecondTimer = new AverageMillisecondTimer(); - public override void OnDraw(Graphics2D graphics2D) - { - totalDrawTime.Restart(); - base.OnDraw(graphics2D); - totalDrawTime.Stop(); - - millisecondTimer.Update((int)totalDrawTime.ElapsedMilliseconds); - millisecondTimer.Draw(graphics2D, this.Width * 3 / 4 - 15, this.Height - 40); - } -#endif - private void AddHandlers() { ActiveTheme.Instance.ThemeChanged.RegisterEvent(ThemeChanged, ref unregisterEvents);