contains method

bool contains(
  1. Position position
)

Whether position is inside this rectangle (inclusive of edges).

Implementation

bool contains(Position position) =>
    position.x >= x &&
    position.x < right &&
    position.y >= y &&
    position.y < bottom;