From 0580db2296d97f95a022cdcead94124366777be3 Mon Sep 17 00:00:00 2001 From: Lars Brubaker Date: Mon, 11 Jun 2018 16:44:47 -0700 Subject: [PATCH] Make Operation Source apply create a group if more than 1 item issue: MatterHackers/MCCentral#3544 Apply array needs to return a collection of the children (rather than a bunch of children) --- DesignTools/Operations/OperationSource.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/DesignTools/Operations/OperationSource.cs b/DesignTools/Operations/OperationSource.cs index b59935d26..0d50f00e3 100644 --- a/DesignTools/Operations/OperationSource.cs +++ b/DesignTools/Operations/OperationSource.cs @@ -92,6 +92,19 @@ namespace MatterHackers.MatterControl.DesignTools.Operations { list.Remove(sourceItem); } + + if (list.Count > 1) + { + // wrap the children in an object so they remain a group + var group = new Object3D(); + group.Children.Modify((groupList) => + { + groupList.AddRange(list); + }); + + list.Clear(); + list.Add(group); + } }); parent.ResumeRebuild();