hitShallow method

SceneNode? hitShallow(
  1. double x,
  2. double y, {
  3. FrameNode? scope,
})

Topmost direct child of scope containing the point (artboard coords).

Implementation

SceneNode? hitShallow(double x, double y, {FrameNode? scope}) {
  var frame = scope ?? root;
  for (var c in frame.children.reversed) {
    var rect = c.measured;
    if (c.visible && rect != null && rect.contains(x, y)) return c;
  }
  return null;
}