undo method

void undo()

Undoes the last painting action by moving it from the history to the redo history and notifies listeners.

Implementation

void undo() {
  if (historyPosition > 0) {
    historyPosition--;
  }
}