mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 18:50:00 +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);
|
selections.splice(1, selections.length - 1);
|
||||||
|
|
||||||
// Add history entry.
|
// Add history entry.
|
||||||
History.push(
|
History.push(null, { setProperties: undoData }, { setProperties: redoData });
|
||||||
{ setProperties: undoData },
|
|
||||||
{ setProperties: redoData }
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function ungroup() {
|
function ungroup() {
|
||||||
|
@ -248,10 +245,7 @@ Groups = function () {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add history entry.
|
// Add history entry.
|
||||||
History.push(
|
History.push(null, { setProperties: undoData }, { setProperties: redoData });
|
||||||
{ setProperties: undoData },
|
|
||||||
{ setProperties: redoData }
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function clear() {
|
function clear() {
|
||||||
|
|
|
@ -47,8 +47,9 @@ History = (function () {
|
||||||
],
|
],
|
||||||
MAX_HISTORY_ITEMS = 1000,
|
MAX_HISTORY_ITEMS = 1000,
|
||||||
undoPosition = -1, // The next history item to undo; the next history item to redo = undoIndex + 1.
|
undoPosition = -1, // The next history item to undo; the next history item to redo = undoIndex + 1.
|
||||||
undoData = [{}, {}],
|
undoData = [{}, {}, {}], // Left side, right side, no side.
|
||||||
redoData = [{}, {}];
|
redoData = [{}, {}, {}],
|
||||||
|
NO_SIDE = 2;
|
||||||
|
|
||||||
function doKick(entityID) {
|
function doKick(entityID) {
|
||||||
var properties,
|
var properties,
|
||||||
|
@ -81,6 +82,9 @@ History = (function () {
|
||||||
|
|
||||||
function push(side, undo, redo) {
|
function push(side, undo, redo) {
|
||||||
// Add a history entry.
|
// Add a history entry.
|
||||||
|
if (side === null) {
|
||||||
|
side = NO_SIDE;
|
||||||
|
}
|
||||||
undoData[side] = Object.merge(undoData[side], undo);
|
undoData[side] = Object.merge(undoData[side], undo);
|
||||||
redoData[side] = Object.merge(redoData[side], redo);
|
redoData[side] = Object.merge(redoData[side], redo);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue