From c802c74396689e4e6ebd81c4917ec7c4e4d79ef8 Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Tue, 28 Oct 2014 13:48:48 -0700 Subject: [PATCH] Add comment to new redo functionality --- libraries/script-engine/src/UndoStackScriptingInterface.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libraries/script-engine/src/UndoStackScriptingInterface.cpp b/libraries/script-engine/src/UndoStackScriptingInterface.cpp index 6ee3735c13..17bf8b1aa6 100644 --- a/libraries/script-engine/src/UndoStackScriptingInterface.cpp +++ b/libraries/script-engine/src/UndoStackScriptingInterface.cpp @@ -42,8 +42,12 @@ void ScriptUndoCommand::undo() { } void ScriptUndoCommand::redo() { + // QUndoStack will call `redo()` when adding a command to the stack. This + // makes it difficult to work with commands that span a period of time - for instance, + // the entity duplicate + move command that duplicates an entity and then moves it. + // A better implementation might be to properly implement `mergeWith()` and `id()` + // so that the two actions in the example would be merged. if (_hasRedone) { - qDebug() << "Doing redo!"; QMetaObject::invokeMethod(this, "doRedo"); } _hasRedone = true;