made the test work better (pass)
This commit is contained in:
parent
1579632c77
commit
d71230596c
1 changed files with 9 additions and 11 deletions
|
|
@ -103,25 +103,23 @@ namespace MatterHackers.MatterControl.DesignTools.Operations
|
|||
// if the items we are replacing ar already in a list
|
||||
if (item.Parent != null)
|
||||
{
|
||||
var replaceItems = new List<IObject3D> { item };
|
||||
IObject3D replaceItem = item;
|
||||
if (undoBuffer != null)
|
||||
{
|
||||
replaceItem = item.Clone();
|
||||
}
|
||||
|
||||
var firstChild = new Object3D();
|
||||
this.Children.Add(firstChild);
|
||||
firstChild.Children.Add(replaceItem);
|
||||
|
||||
var replace = new ReplaceCommand(replaceItems, new List<IObject3D> { this });
|
||||
if (undoBuffer != null)
|
||||
{
|
||||
IObject3D replaceItem = item.Clone();
|
||||
firstChild.Children.Add(replaceItem);
|
||||
var replace = new ReplaceCommand(new List<IObject3D> { item }, new List<IObject3D> { this });
|
||||
undoBuffer.AddAndDo(replace);
|
||||
}
|
||||
else
|
||||
{
|
||||
replace.Do();
|
||||
item.Parent.Children.Modify(list =>
|
||||
{
|
||||
list.Remove(item);
|
||||
list.Add(this);
|
||||
});
|
||||
firstChild.Children.Add(item);
|
||||
}
|
||||
}
|
||||
else // just add them
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue