refactoring to EditorDraw

This commit is contained in:
LarsBrubaker 2020-10-08 22:17:52 -07:00
parent f01914f1b1
commit e1b1757af1
4 changed files with 19 additions and 11 deletions

View file

@ -910,14 +910,6 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
var transparentMeshes = new List<Object3DView>();
var selectedItem = scene.SelectedItem;
if (selectedItem != null)
{
// Invoke existing IEditorDraw when iterating items
if (selectedItem is IEditorDraw editorDraw)
{
editorDraw.DrawEditor(this, transparentMeshes, e);
}
}
foreach (var item in scene.Children)
{
@ -1002,6 +994,16 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
floorDrawable.Draw(this, e, Matrix4X4.Identity, this.World);
}
// Draw the editor items in the same scope as the 3D Controls
if (selectedItem != null)
{
// Invoke existing IEditorDraw when iterating items
if (selectedItem is IEditorDraw editorDraw)
{
editorDraw.DrawEditor(this, transparentMeshes, e);
}
}
DrawObject3DControlVolumes(e);
foreach (var drawable in drawables.Where(d => d.DrawStage == DrawStage.TransparentContent))