containsTextRegion method
Text activation follows declared regions, including external frame titles.
Implementation
bool containsTextRegion(DiagramPoint worldPoint) {
final local = worldToLocal(worldPoint);
final textLayers = layers.where(
(layer) => layer.definition is ShapeTextLayerDefinition,
);
// Content such as a table lays out its own text regions. Child-owning
// shapes use this same hit test for entering and remaining in editing.
return textLayers.isEmpty
? hostsText && (text?.clipBounds.contains(local) ?? false)
: textLayers.any((layer) => layer.bounds.contains(local));
}