Fix empty Layer2D view
- Refactor ViewControlsToggle - Remove public accessors to button controls - Add event for changing modes - Subscribe to new event - Collapse named functions into single use callers for clarity
This commit is contained in:
parent
5e0e35cdc1
commit
e45a0f16f7
4 changed files with 80 additions and 77 deletions
|
|
@ -294,27 +294,21 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
GCodeRenderer.ExtruderWidth = .4;
|
||||
}
|
||||
|
||||
await Task.Run(() => DoPostLoadInitialization());
|
||||
|
||||
postLoadInitialization_RunWorkerCompleted();
|
||||
}
|
||||
|
||||
public void DoPostLoadInitialization()
|
||||
{
|
||||
try
|
||||
await Task.Run(() =>
|
||||
{
|
||||
gCodeRenderer.GCodeFileToDraw?.GetFilamentUsedMm(ActiveSliceSettings.Instance.GetValue<double>(SettingsKey.filament_diameter));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Print(e.Message);
|
||||
GuiWidget.BreakInDebugger();
|
||||
}
|
||||
gCodeRenderer.CreateFeaturesForLayerIfRequired(0);
|
||||
}
|
||||
// DoPostLoadInitialization()
|
||||
try
|
||||
{
|
||||
gCodeRenderer.GCodeFileToDraw?.GetFilamentUsedMm(ActiveSliceSettings.Instance.GetValue<double>(SettingsKey.filament_diameter));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.Print(ex.Message);
|
||||
GuiWidget.BreakInDebugger();
|
||||
}
|
||||
gCodeRenderer.CreateFeaturesForLayerIfRequired(0);
|
||||
});
|
||||
|
||||
private void postLoadInitialization_RunWorkerCompleted()
|
||||
{
|
||||
DoneLoading?.Invoke(this, null);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue