when moving a group of selections, don't move a child if a parent is being moved

This commit is contained in:
Seth Alves 2018-04-03 11:11:51 -07:00
parent aceb3d13b4
commit 08b7326bd1

View file

@ -1618,8 +1618,16 @@ SelectionDisplay = (function() {
grid.snapToGrid(Vec3.sum(cornerPosition, vector), constrainMajorOnly),
cornerPosition);
for (var i = 0; i < SelectionManager.selections.length; i++) {
var properties = SelectionManager.savedProperties[SelectionManager.selections[i]];
var toMove = SelectionManager.selections.filter(function (selection) {
if (SelectionManager.selections.indexOf(SelectionManager.savedProperties[selection].parentID) >= 0) {
return false; // a parent is also being moved, so don't issue an edit for this entity
} else {
return true;
}
});
for (var i = 0; i < toMove.length; i++) {
var properties = SelectionManager.savedProperties[toMove[i]];
if (!properties) {
continue;
}
@ -1628,7 +1636,7 @@ SelectionDisplay = (function() {
y: 0,
z: vector.z
});
Entities.editEntity(SelectionManager.selections[i], {
Entities.editEntity(toMove[i], {
position: newPosition
});