querySelect method

  1. @override
bool querySelect(
  1. DrawRectangle object,
  2. Offset focalPoint,
  3. Matrix4 transform,
  4. Size size,
)
override

Returning true will select the object.

This is needed as the consumer can't know a DrawObject's size or position.

Implementation

@override
bool querySelect(
  DrawRectangle object,
  Offset focalPoint,
  Matrix4 transform,
  Size size,
) {
  return object
      .getHitboxes(size)
      .any((hitbox) => hitbox.contains(focalPoint));
}