hitTest method

bool hitTest(
  1. Offset? anchor
)

判断热区是否命中

Implementation

bool hitTest(Offset? anchor) {
  if (anchor == null) {
    return false;
  }

  if (originRect?.contains(anchor) == true) {
    return true;
  }

  if (path?.contains(anchor) == true) {
    return true;
  }

  Rect? hotRect = getHotRect();
  if (hotRect?.contains(anchor) == true) {
    return true;
  }

  return false;
}