contains method

bool contains(
  1. Point point
)

Check if a point is inside this rectangle

Implementation

bool contains(Point point) {
  return point.x >= x &&
      point.x <= x + width &&
      point.y >= y &&
      point.y <= y + height;
}