Fix undo and redo order.

This commit is contained in:
Relintai 2022-06-21 19:15:07 +02:00
parent 10eeb612b0
commit 50530c4f79

View File

@ -643,8 +643,8 @@ void PaintWindow::redo_action() {
return; return;
} }
Ref<PaintAction> action = _redo_history[0]; Ref<PaintAction> action = _redo_history[_redo_history.size() - 1];
_redo_history.remove(0); _redo_history.remove(_redo_history.size() - 1);
if (!action.is_valid()) { if (!action.is_valid()) {
return; return;
@ -661,8 +661,8 @@ void PaintWindow::undo_action() {
return; return;
} }
Ref<PaintAction> action = _actions_history[0]; Ref<PaintAction> action = _actions_history[_actions_history.size() - 1];
_actions_history.remove(0); _actions_history.remove(_actions_history.size() - 1);
if (!action.is_valid()) { if (!action.is_valid()) {
return; return;