hitTest method

CanvasObject? hitTest(
  1. double x,
  2. double y
)

Returns the topmost object at x, y.

Implementation

CanvasObject? hitTest(double x, double y) {
  for (final object in _objects.reversed) {
    if (object.hidden) continue;
    if (_containsPoint(object, x, y)) return object;
  }
  return null;
}