visualBounds property

DiagramRect get visualBounds

Includes the centered border without changing text layout or label size.

Implementation

DiagramRect get visualBounds => switch (source.presentation) {
  PlainLabelPresentation() => bounds,
  BadgeLabelPresentation(:final strokeWidth) => bounds.inflate(
    strokeWidth / 2,
  ),
};