namedRects function

Map<String, SceneRect> namedRects(
  1. Map<SceneNode, SceneRect> rects
)

The same rects under the names the nodes carry — what the guest sends back over the wire, and what a surface holding a PARSED document asks its geometry by.

Meaningless for a compiled scene, whose nodes have no names: every entry would land on the empty string. That is the whole reason SceneMeasured hands over the nodes and this is a separate step.

Implementation

Map<String, SceneRect> namedRects(Map<SceneNode, SceneRect> rects) => {
  for (var entry in rects.entries)
    if (entry.key.name.isNotEmpty) entry.key.name: entry.value,
};