findClickAxis method

BaseAxisImpl<BaseAxis, dynamic>? findClickAxis(
  1. Offset offset
)

找到当前点击的

Implementation

BaseAxisImpl? findClickAxis(Offset offset) {
  BaseAxisImpl? node;
  for (var ele in _axisMap.entries) {
    if (!ele.value.show) {
      continue;
    }
    List<Offset> ol;
    if (props.direction == Direction.horizontal) {
      ol = [ele.value.props.rect.topLeft, ele.value.props.rect.bottomLeft];
    } else {
      ol = [ele.value.props.rect.topLeft, ele.value.props.rect.topRight];
    }
    if (offset.inLine(ol[0], ol[1])) {
      node = ele.value;
      break;
    }
  }
  return node;
}