isRectContained function

bool isRectContained(
  1. Size size,
  2. Rect rect
)

Returns true if rect is left and top are bigger than 0 and if right and bottom are smaller than size width and height

Implementation

bool isRectContained(Size size, Rect rect) =>
    rect.left >= 0 &&
    rect.top >= 0 &&
    rect.right <= size.width &&
    rect.bottom <= size.height;