moveSelectedAnnotations method
void
moveSelectedAnnotations(
- 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!.position + delta;
annotation.position = newPosition;
// Update visual position with snapping (identical to node behavior)
annotation.visualPosition = _parentController.config
.snapAnnotationsToGridIfEnabled(newPosition);
movedAnnotationIds.add(annotationId);
}
}
});
// Mark moved annotations dirty
for (final annotationId in movedAnnotationIds) {
_parentController.internalMarkAnnotationDirty(annotationId);
}
}