hitTest method

  1. @nonVirtual
Iterable<Node> hitTest(
  1. Vector2 point
)
inherited

Finds every node in this subtree whose hit area contains point, per containsPoint, topmost first. A node hearing no input hides its whole subtree.

Unlike add, remove, and priority, enabled takes effect immediately even on a mounted node. A handler invoked mid-walk that disables an unvisited node will affect that same walk.

TODO: Should it really do that? Is enabled actually a tree operation?

Implementation

@nonVirtual
Iterable<Node> hitTest(Vector2 point) =>
    // TODO: Controls prunes on this same predicate, so "input does not reach
    //  here" is now stated at two call sites rather than once. Decide where
    //  input reachability actually belongs; it is not the traversal's business.
    traverse(prune: ((node) => !node.activity.inputs)) //
        .where((node) => node.containsPoint(point));