containsPoint method

bool containsPoint(
  1. num px,
  2. num py
)

Checks if the rectangle contains the point (px, py).

  • px: The x-coordinate of the point.
  • py: The y-coordinate of the point.

Returns true if the point is inside the rectangle, false otherwise.

Implementation

bool containsPoint(num px, num py) {
  return px >= left && px < right && py >= top && py < bottom;
}