fix(editor): undo history causes crash when it overflows

This commit is contained in:
maelstrom 2025-06-30 21:59:15 +02:00
parent dd5c3a0638
commit 4188e2d9e1

View file

@ -7,7 +7,7 @@ void UndoHistory::PushState(UndoState state) {
redoHistory = {};
if (maxBufferSize != -1 && (int)undoHistory.size() > maxBufferSize)
undoHistory.erase(undoHistory.begin(), undoHistory.begin()+maxBufferSize-(int)undoHistory.size()-1);
undoHistory.pop_front();
undoHistory.push_back(state);
undoStateListener();