undo method

bool undo()

Restores the previous scene state.

Implementation

bool undo() {
  if (_undoStack.isEmpty) return false;
  _pushRedo(toJson());
  _loadJson(_undoStack.removeLast());
  render();
  onUndo?.call(this);
  return true;
}