This commit is contained in:
David Back 2018-07-06 15:48:53 -07:00
parent 33e170315c
commit a546d8b279

View file

@ -180,17 +180,17 @@ SelectionManager = (function() {
that.selections = []; that.selections = [];
that._update(true); that._update(true);
}; };
that.addChildrenEntities = function(parentEntityID, entityList) { that.addChildrenEntities = function(parentEntityID, entityList) {
var children = Entities.getChildrenIDs(parentEntityID); var children = Entities.getChildrenIDs(parentEntityID);
for (var i = 0; i < children.length; i++) { for (var i = 0; i < children.length; i++) {
var childID = children[i]; var childID = children[i];
if (entityList.indexOf(childID) < 0) { if (entityList.indexOf(childID) < 0) {
entityList.push(childID); entityList.push(childID);
} }
that.addChildrenEntities(childID, entityList); that.addChildrenEntities(childID, entityList);
} }
}; };
that.duplicateSelection = function() { that.duplicateSelection = function() {
var entitiesToDuplicate = []; var entitiesToDuplicate = [];
@ -203,7 +203,7 @@ SelectionManager = (function() {
if (entitiesToDuplicate.indexOf(originalEntityID) < 0) { if (entitiesToDuplicate.indexOf(originalEntityID) < 0) {
entitiesToDuplicate.push(originalEntityID); entitiesToDuplicate.push(originalEntityID);
} }
that.addChildrenEntities(originalEntityID, entitiesToDuplicate); that.addChildrenEntities(originalEntityID, entitiesToDuplicate);
}); });
// duplicate entities from above and store their original to new entity mappings and children needing re-parenting // duplicate entities from above and store their original to new entity mappings and children needing re-parenting