moveSelectedAnnotations method

void moveSelectedAnnotations(
  1. Offset delta
)

Implementation

void moveSelectedAnnotations(Offset delta) {
  final movedAnnotationIds = <String>[];
  runInAction(() {
    for (final annotationId in _selectedAnnotationIds) {
      final annotation = _annotations[annotationId];
      if (annotation?.isInteractive == true) {
        final newPosition = annotation!.currentPosition + delta;
        annotation.setPosition(newPosition);
        // Update visual position with snapping (identical to node behavior)
        annotation.setVisualPosition(
          _parentController.config.snapAnnotationsToGridIfEnabled(
            newPosition,
          ),
        );
        movedAnnotationIds.add(annotationId);
      }
    }
  });
  // Mark moved annotations dirty
  for (final annotationId in movedAnnotationIds) {
    _parentController.internalMarkAnnotationDirty(annotationId);
  }
}