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