mirror of
https://github.com/overte-org/overte.git
synced 2025-08-04 02:43:32 +02:00
when moving a group of selections, don't move a child if a parent is being moved
This commit is contained in:
parent
aceb3d13b4
commit
08b7326bd1
1 changed files with 11 additions and 3 deletions
|
@ -1618,8 +1618,16 @@ SelectionDisplay = (function() {
|
||||||
grid.snapToGrid(Vec3.sum(cornerPosition, vector), constrainMajorOnly),
|
grid.snapToGrid(Vec3.sum(cornerPosition, vector), constrainMajorOnly),
|
||||||
cornerPosition);
|
cornerPosition);
|
||||||
|
|
||||||
for (var i = 0; i < SelectionManager.selections.length; i++) {
|
var toMove = SelectionManager.selections.filter(function (selection) {
|
||||||
var properties = SelectionManager.savedProperties[SelectionManager.selections[i]];
|
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) {
|
if (!properties) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -1628,7 +1636,7 @@ SelectionDisplay = (function() {
|
||||||
y: 0,
|
y: 0,
|
||||||
z: vector.z
|
z: vector.z
|
||||||
});
|
});
|
||||||
Entities.editEntity(SelectionManager.selections[i], {
|
Entities.editEntity(toMove[i], {
|
||||||
position: newPosition
|
position: newPosition
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue