resetState method

void resetState()

Resets all interaction state to default values.

Clears all ongoing interactions and unlocks the canvas. This is useful when canceling all interactions or resetting the editor. Note: Cursor is derived from state, so clearing state automatically resets cursor.

Implementation

void resetState() {
  runInAction(() {
    draggedNodeId.value = null;
    lastPointerPosition.value = null;
    temporaryConnection.value = null;
    selectionStart.value = null;
    selectionRect.value = null;
    canvasLocked.value = false;
    isViewportInteracting.value = false;
    hoveringConnection.value = false;
    cursorOverride.value = null;
    selectionStarted.value = false;
    resizingNodeId.value = null;
    resizeHandle.value = null;
  });
}