cleanForwardChanges method

void cleanForwardChanges()

Clears forward changes from the history.

Implementation

void cleanForwardChanges() {
  if (history.length > 1) {
    while (screenshotHistoryPosition < history.length - 1) {
      history.removeLast();
    }
    while (screenshotHistoryPosition < screenshotHistory.length - 1) {
      screenshotHistory.removeLast();
    }
  }
  screenshotHistoryPosition = history.length - 1;
}