mirror of
https://github.com/overte-org/overte.git
synced 2025-08-05 02:37:02 +02:00
Add undo/redo for clone
This commit is contained in:
parent
003c1c7bc5
commit
709e7e7d90
1 changed files with 11 additions and 0 deletions
|
@ -531,6 +531,8 @@ Selection = function (side) {
|
|||
intersectedEntityIndex = 0,
|
||||
parentID,
|
||||
properties,
|
||||
undoData = [],
|
||||
redoData = [],
|
||||
i,
|
||||
j,
|
||||
length;
|
||||
|
@ -556,10 +558,19 @@ Selection = function (side) {
|
|||
properties.parentID = selection[parentIDIndexes[i]].id;
|
||||
}
|
||||
selection[i].id = Entities.addEntity(properties);
|
||||
undoData.push({ entityID: selection[i].id });
|
||||
redoData.push({ entityID: selection[i].id, properties: properties });
|
||||
}
|
||||
|
||||
// Update selection info.
|
||||
intersectedEntityID = selection[intersectedEntityIndex].id;
|
||||
rootEntityID = selection[0].id;
|
||||
|
||||
// Add history entry.
|
||||
History.push(
|
||||
{ deleteEntities: undoData },
|
||||
{ createEntities: redoData }
|
||||
);
|
||||
}
|
||||
|
||||
function applyColor(color, isApplyToAll) {
|
||||
|
|
Loading…
Reference in a new issue