mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 11:48:09 +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,
|
intersectedEntityIndex = 0,
|
||||||
parentID,
|
parentID,
|
||||||
properties,
|
properties,
|
||||||
|
undoData = [],
|
||||||
|
redoData = [],
|
||||||
i,
|
i,
|
||||||
j,
|
j,
|
||||||
length;
|
length;
|
||||||
|
@ -556,10 +558,19 @@ Selection = function (side) {
|
||||||
properties.parentID = selection[parentIDIndexes[i]].id;
|
properties.parentID = selection[parentIDIndexes[i]].id;
|
||||||
}
|
}
|
||||||
selection[i].id = Entities.addEntity(properties);
|
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;
|
intersectedEntityID = selection[intersectedEntityIndex].id;
|
||||||
rootEntityID = selection[0].id;
|
rootEntityID = selection[0].id;
|
||||||
|
|
||||||
|
// Add history entry.
|
||||||
|
History.push(
|
||||||
|
{ deleteEntities: undoData },
|
||||||
|
{ createEntities: redoData }
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function applyColor(color, isApplyToAll) {
|
function applyColor(color, isApplyToAll) {
|
||||||
|
|
Loading…
Reference in a new issue