topLeftRect function

Rectangle topLeftRect(
  1. Rectangle area,
  2. int width,
  3. int height
)

Returns a new Rectangle at the top-left of area with width and height.

Implementation

Rectangle topLeftRect(Rectangle area, int width, int height) {
  return rect(area.minX, area.minY, width, height).intersect(area);
}