isPointWithinBounds method

bool isPointWithinBounds(
  1. Point<double> chartPoint,
  2. Rectangle<int>? bounds
)
inherited

Returns true of chartPoint is within the component bounds for this renderer.

chartPoint a point to test.

bounds optional override for component bounds. If this is passed, then we will check whether the point is within these bounds instead of the component bounds.

Implementation

bool isPointWithinBounds(Point<double> chartPoint, Rectangle<int>? bounds) {
  // Was it even in the drawArea?
  if (bounds != null) {
    if (!bounds.containsPoint(chartPoint)) {
      return false;
    }
  } else if (componentBounds == null ||
      !componentBounds!.containsPoint(chartPoint)) {
    return false;
  }

  return true;
}