onNodeResized method

  1. @override
void onNodeResized(
  1. String nodeId,
  2. Size newSize,
  3. AnnotationDragContext context
)
override

Called when a node's size changes.

Override this method to respond when a tracked node is resized. For GroupAnnotation with explicit behavior, this triggers a refit.

Implementation

@override
void onNodeResized(
  String nodeId,
  Size newSize,
  AnnotationDragContext context,
) {
  // Only explicit behavior auto-resizes when member nodes resize
  if (behavior != GroupBehavior.explicit) return;
  if (!_nodeIds.contains(nodeId)) return;

  // Refit to contain all member nodes
  fitToNodes(context.getNode);
}