diagramResizeSelectionClosure function

Map<String, DiagramElement> diagramResizeSelectionClosure(
  1. DiagramDocument document,
  2. Set<String> ids,
  3. ShapeRegistry registry
)

A frame boundary can resize independently; logical groups scale their subtree.

Implementation

Map<String, DiagramElement> diagramResizeSelectionClosure(
  DiagramDocument document,
  Set<String> ids,
  ShapeRegistry registry,
) {
  final roots = diagramSelectionRoots(document, ids);
  final boundaryOnly = <String>{
    for (final id in roots)
      if (document.shapeById(id) case final shape?)
        if (!(registry.require(shape.type).container?.resizesChildren ?? true))
          id,
  };
  return {
    ...diagramSelectionClosure(document, roots.difference(boundaryOnly)),
    for (final id in boundaryOnly) id: document.elementById(id)!,
  };
}