Fixed redo not working correctly
This commit is contained in:
parent
a83a38eba8
commit
635d999c2c
|
@ -34,7 +34,8 @@ namespace SHADE
|
|||
|
||||
bool UndoRedoStack::RedoActionPresent::get()
|
||||
{
|
||||
return latestActionIndex >= 0 && latestActionIndex < commandStack->Count - 1;
|
||||
const int REDO_ACTION_INDEX = latestActionIndex + 1;
|
||||
return REDO_ACTION_INDEX >= 0 && REDO_ACTION_INDEX < commandStack->Count;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------------*/
|
||||
|
@ -70,7 +71,8 @@ namespace SHADE
|
|||
if (!RedoActionPresent)
|
||||
return;
|
||||
|
||||
ICommand^ cmd = commandStack[latestActionIndex];
|
||||
const int REDO_ACTION_INDEX = latestActionIndex + 1;
|
||||
ICommand^ cmd = commandStack[REDO_ACTION_INDEX];
|
||||
cmd->Execute();
|
||||
++latestActionIndex;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue