---
title: "IntRect"
description: "Construct a rectangle from its left and top edges as well as its width and height."
type: "function"
---

<div class='type'>Function</div>


<a id='references'></a>
<div class='sourceset sourceset-common'>Common</div>


```kotlin
fun IntRect(offset: IntOffset, size: IntSize) =
    IntRect(
        left = offset.x,
        top = offset.y,
        right = offset.x + size.width,
        bottom = offset.y + size.height,
    )
```


Construct a rectangle from its left and top edges as well as its width and height.

#### Parameters

| | |
| --- | --- |
| offset | Offset to represent the top and left parameters of the Rect |
| size | Size to determine the width and height of this `IntRect`. |


#### Returns

| | |
| --- | --- |
|  | Rect with `IntRect.left` and `IntRect.top` configured to `IntOffset.x` and `IntOffset.y` as `IntRect.right` and `IntRect.bottom` to `IntOffset.x` + `IntSize.width` and `IntOffset.y` + `IntSize.height` respectively |




<div class='sourceset sourceset-common'>Common</div>


```kotlin
fun IntRect(topLeft: IntOffset, bottomRight: IntOffset): IntRect
```


Construct the smallest rectangle that encloses the given offsets, treating them as vectors from
the origin.

#### Parameters

| | |
| --- | --- |
| topLeft | Offset representing the left and top edges of the rectangle |
| bottomRight | Offset representing the bottom and right edges of the rectangle |




<div class='sourceset sourceset-common'>Common</div>


```kotlin
fun IntRect(center: IntOffset, radius: Int): IntRect
```


Construct a rectangle that bounds the given circle

#### Parameters

| | |
| --- | --- |
| center | Offset that represents the center of the circle |
| radius | Radius of the circle to enclose |




