mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 11:45:36 +02:00
Update undo for grouping
This commit is contained in:
parent
21d286b422
commit
1673c08353
2 changed files with 8 additions and 10 deletions
|
@ -143,10 +143,7 @@ Groups = function () {
|
|||
selections.splice(1, selections.length - 1);
|
||||
|
||||
// Add history entry.
|
||||
History.push(
|
||||
{ setProperties: undoData },
|
||||
{ setProperties: redoData }
|
||||
);
|
||||
History.push(null, { setProperties: undoData }, { setProperties: redoData });
|
||||
}
|
||||
|
||||
function ungroup() {
|
||||
|
@ -248,10 +245,7 @@ Groups = function () {
|
|||
}
|
||||
|
||||
// Add history entry.
|
||||
History.push(
|
||||
{ setProperties: undoData },
|
||||
{ setProperties: redoData }
|
||||
);
|
||||
History.push(null, { setProperties: undoData }, { setProperties: redoData });
|
||||
}
|
||||
|
||||
function clear() {
|
||||
|
|
|
@ -47,8 +47,9 @@ History = (function () {
|
|||
],
|
||||
MAX_HISTORY_ITEMS = 1000,
|
||||
undoPosition = -1, // The next history item to undo; the next history item to redo = undoIndex + 1.
|
||||
undoData = [{}, {}],
|
||||
redoData = [{}, {}];
|
||||
undoData = [{}, {}, {}], // Left side, right side, no side.
|
||||
redoData = [{}, {}, {}],
|
||||
NO_SIDE = 2;
|
||||
|
||||
function doKick(entityID) {
|
||||
var properties,
|
||||
|
@ -81,6 +82,9 @@ History = (function () {
|
|||
|
||||
function push(side, undo, redo) {
|
||||
// Add a history entry.
|
||||
if (side === null) {
|
||||
side = NO_SIDE;
|
||||
}
|
||||
undoData[side] = Object.merge(undoData[side], undo);
|
||||
redoData[side] = Object.merge(redoData[side], redo);
|
||||
|
||||
|
|
Loading…
Reference in a new issue