diff --git a/MatterControlLib/ApplicationView/BedConfig.cs b/MatterControlLib/ApplicationView/BedConfig.cs index 3caa20982..4719de161 100644 --- a/MatterControlLib/ApplicationView/BedConfig.cs +++ b/MatterControlLib/ApplicationView/BedConfig.cs @@ -193,6 +193,11 @@ namespace MatterHackers.MatterControl } public InsertionGroupObject3D AddToPlate(IEnumerable itemsToAdd) + { + return this.AddToPlate(itemsToAdd, (this.Printer != null) ? this.Printer.Bed.BedCenter : Vector2.Zero, true); + } + + public InsertionGroupObject3D AddToPlate(IEnumerable itemsToAdd, Vector2 initialPosition, bool moveToOpenPosition) { if (this.Printer != null && this.Printer.ViewState.ViewMode != PartViewMode.Model) @@ -211,10 +216,13 @@ namespace MatterHackers.MatterControl itemsToAdd, context.View3DWidget, scene, - (Printer != null) ? Printer.Bed.BedCenter : Vector2.Zero, + initialPosition, (item, itemsToAvoid) => { - PlatingHelper.MoveToOpenPositionRelativeGroup(item, itemsToAvoid); + if (moveToOpenPosition) + { + PlatingHelper.MoveToOpenPositionRelativeGroup(item, itemsToAvoid); + } })); }); diff --git a/MatterControlLib/DesignTools/Primitives/ImageObject3D.cs b/MatterControlLib/DesignTools/Primitives/ImageObject3D.cs index d857ab218..d24eda6f1 100644 --- a/MatterControlLib/DesignTools/Primitives/ImageObject3D.cs +++ b/MatterControlLib/DesignTools/Primitives/ImageObject3D.cs @@ -92,7 +92,6 @@ namespace MatterHackers.MatterControl.DesignTools var graphics2D = _image.NewGraphics2D(); graphics2D.Clear(Color.White); graphics2D.DrawString("Bad Load", 100, 100); - } // we don't want to invalidate on the mesh change diff --git a/MatterControlLib/DesignTools/Primitives/TextObject3D.cs b/MatterControlLib/DesignTools/Primitives/TextObject3D.cs index 1e7c63b26..7be124365 100644 --- a/MatterControlLib/DesignTools/Primitives/TextObject3D.cs +++ b/MatterControlLib/DesignTools/Primitives/TextObject3D.cs @@ -142,7 +142,6 @@ namespace MatterHackers.MatterControl.DesignTools } }); - if (aabb.ZSize > 0) { // If the part was already created and at a height, maintain the height. diff --git a/MatterControlLib/PartPreviewWindow/View3D/View3DWidget.cs b/MatterControlLib/PartPreviewWindow/View3D/View3DWidget.cs index 311fb8609..bec8e7206 100644 --- a/MatterControlLib/PartPreviewWindow/View3D/View3DWidget.cs +++ b/MatterControlLib/PartPreviewWindow/View3D/View3DWidget.cs @@ -999,13 +999,8 @@ namespace MatterHackers.MatterControl.PartPreviewWindow // Set the hitplane to the bed plane CurrentSelectInfo.HitPlane = bedPlane; - var insertionGroup = new InsertionGroupObject3D( - items, - this, - Scene, - Vector2.Zero, - null, - trackSourceFiles); + // Add item to scene + var insertionGroup = sceneContext.AddToPlate(items, Vector2.Zero, moveToOpenPosition: false); // Find intersection position of the mouse with the bed plane var intersectInfo = GetIntersectPosition(screenSpaceMousePosition); @@ -1020,11 +1015,6 @@ namespace MatterHackers.MatterControl.PartPreviewWindow this.deferEditorTillMouseUp = true; - // Add item to scene and select it - Scene.Children.Modify(list => - { - list.Add(insertionGroup); - }); Scene.SelectedItem = insertionGroup; this.DragDropObject = insertionGroup;