undoAction method

void undoAction()

Undo the last editing action.

This function allows the user to undo the most recent editing action performed on the image. It decreases the edit position, and the image is decoded to reflect the previous state.

Implementation

void undoAction() {
  if (stateManager.position > 0) {
    setState(() {
      layerInteractionManager.selectedLayerId = '';
      _checkInteractiveViewer();
      stateManager.position--;
      decodeImage();
    });
    mainEditorCallbacks?.handleUndo();
  }
}