# RectKt

Added in 1.1.0

*** ** * ** ***


```
public final class RectKt
```

<br />

*** ** * ** ***

## Summary

| ### Public methods |
|---|---|
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Rect.html` | `https://developer.android.com/reference/androidx/core/graphics/RectKt#(android.graphics.Rect).and(android.graphics.Rect)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Rect.html receiver, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Rect.html r)` Returns the intersection of two rectangles as a new rectangle. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/RectF.html` | `https://developer.android.com/reference/androidx/core/graphics/RectKt#(android.graphics.RectF).and(android.graphics.RectF)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/RectF.html receiver, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/RectF.html r)` Returns the intersection of two rectangles as a new rectangle. |
| `static final int` | `https://developer.android.com/reference/androidx/core/graphics/RectKt#(android.graphics.Rect).component1()(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Rect.html receiver)` Returns "left", the first component of the rectangle. |
| `static final float` | `https://developer.android.com/reference/androidx/core/graphics/RectKt#(android.graphics.RectF).component1()(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/RectF.html receiver)` Returns "left", the first component of the rectangle. |
| `static final int` | `https://developer.android.com/reference/androidx/core/graphics/RectKt#(android.graphics.Rect).component2()(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Rect.html receiver)` Returns "top", the second component of the rectangle. |
| `static final float` | `https://developer.android.com/reference/androidx/core/graphics/RectKt#(android.graphics.RectF).component2()(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/RectF.html receiver)` Returns "top", the second component of the rectangle. |
| `static final int` | `https://developer.android.com/reference/androidx/core/graphics/RectKt#(android.graphics.Rect).component3()(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Rect.html receiver)` Returns "right", the third component of the rectangle. |
| `static final float` | `https://developer.android.com/reference/androidx/core/graphics/RectKt#(android.graphics.RectF).component3()(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/RectF.html receiver)` Returns "right", the third component of the rectangle. |
| `static final int` | `https://developer.android.com/reference/androidx/core/graphics/RectKt#(android.graphics.Rect).component4()(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Rect.html receiver)` Returns "bottom", the fourth component of the rectangle. |
| `static final float` | `https://developer.android.com/reference/androidx/core/graphics/RectKt#(android.graphics.RectF).component4()(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/RectF.html receiver)` Returns "bottom", the fourth component of the rectangle. |
| `static final boolean` | `https://developer.android.com/reference/androidx/core/graphics/RectKt#(android.graphics.Rect).contains(android.graphics.Point)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Rect.html receiver, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Point.html p)` Returns true if the specified point is inside the rectangle. |
| `static final boolean` | `https://developer.android.com/reference/androidx/core/graphics/RectKt#(android.graphics.RectF).contains(android.graphics.PointF)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/RectF.html receiver, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/PointF.html p)` Returns true if the specified point is inside the rectangle. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Region.html` | `https://developer.android.com/reference/androidx/core/graphics/RectKt#(android.graphics.Rect).minus(android.graphics.Rect)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Rect.html receiver, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Rect.html r)` Returns the difference of this rectangle and the specified rectangle as a new region. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Rect.html` | `https://developer.android.com/reference/androidx/core/graphics/RectKt#(android.graphics.Rect).minus(kotlin.Int)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Rect.html receiver, int xy)` Returns a new rectangle representing this rectangle offset by the negation of the specified amount on both X and Y axis. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Rect.html` | `https://developer.android.com/reference/androidx/core/graphics/RectKt#(android.graphics.Rect).minus(android.graphics.Point)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Rect.html receiver, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Point.html xy)` Returns a new rectangle representing this rectangle offset by the negation of the specified point. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Region.html` | `https://developer.android.com/reference/androidx/core/graphics/RectKt#(android.graphics.RectF).minus(android.graphics.RectF)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/RectF.html receiver, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/RectF.html r)` Returns the difference of this rectangle and the specified rectangle as a new region. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/RectF.html` | `https://developer.android.com/reference/androidx/core/graphics/RectKt#(android.graphics.RectF).minus(kotlin.Float)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/RectF.html receiver, float xy)` Returns a new rectangle representing this rectangle offset by the negation of the specified amount on both X and Y axis. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/RectF.html` | `https://developer.android.com/reference/androidx/core/graphics/RectKt#(android.graphics.RectF).minus(android.graphics.PointF)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/RectF.html receiver, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/PointF.html xy)` Returns a new rectangle representing this rectangle offset by the negation of the specified point. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Rect.html` | `https://developer.android.com/reference/androidx/core/graphics/RectKt#(android.graphics.Rect).or(android.graphics.Rect)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Rect.html receiver, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Rect.html r)` Returns the union of two rectangles as a new rectangle. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/RectF.html` | `https://developer.android.com/reference/androidx/core/graphics/RectKt#(android.graphics.RectF).or(android.graphics.RectF)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/RectF.html receiver, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/RectF.html r)` Returns the union of two rectangles as a new rectangle. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Rect.html` | `https://developer.android.com/reference/androidx/core/graphics/RectKt#(android.graphics.Rect).plus(android.graphics.Rect)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Rect.html receiver, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Rect.html r)` Performs the union of this rectangle and the specified rectangle and returns the result as a new rectangle. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Rect.html` | `https://developer.android.com/reference/androidx/core/graphics/RectKt#(android.graphics.Rect).plus(kotlin.Int)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Rect.html receiver, int xy)` Returns a new rectangle representing this rectangle offset by the specified amount on both X and Y axis. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Rect.html` | `https://developer.android.com/reference/androidx/core/graphics/RectKt#(android.graphics.Rect).plus(android.graphics.Point)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Rect.html receiver, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Point.html xy)` Returns a new rectangle representing this rectangle offset by the specified point. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/RectF.html` | `https://developer.android.com/reference/androidx/core/graphics/RectKt#(android.graphics.RectF).plus(android.graphics.RectF)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/RectF.html receiver, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/RectF.html r)` Performs the union of this rectangle and the specified rectangle and returns the result as a new rectangle. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/RectF.html` | `https://developer.android.com/reference/androidx/core/graphics/RectKt#(android.graphics.RectF).plus(kotlin.Float)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/RectF.html receiver, float xy)` Returns a new rectangle representing this rectangle offset by the specified amount on both X and Y axis. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/RectF.html` | `https://developer.android.com/reference/androidx/core/graphics/RectKt#(android.graphics.RectF).plus(android.graphics.PointF)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/RectF.html receiver, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/PointF.html xy)` Returns a new rectangle representing this rectangle offset by the specified point. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Rect.html` | `https://developer.android.com/reference/androidx/core/graphics/RectKt#(android.graphics.Rect).times(kotlin.Int)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Rect.html receiver, int factor)` Returns a new rectangle representing this rectangle's components each scaled by `https://developer.android.com/reference/androidx/core/graphics/package-summary#(android.graphics.Rect).times(kotlin.Int)`. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/RectF.html` | `https://developer.android.com/reference/androidx/core/graphics/RectKt#(android.graphics.RectF).times(kotlin.Float)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/RectF.html receiver, float factor)` Returns a new rectangle representing this rectangle's components each scaled by `https://developer.android.com/reference/androidx/core/graphics/package-summary#(android.graphics.RectF).times(kotlin.Float)`. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/RectF.html` | `https://developer.android.com/reference/androidx/core/graphics/RectKt#(android.graphics.RectF).times(kotlin.Int)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/RectF.html receiver, int factor)` Returns a new rectangle representing this rectangle's components each scaled by `https://developer.android.com/reference/androidx/core/graphics/package-summary#(android.graphics.RectF).times(kotlin.Int)`. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Rect.html` | `https://developer.android.com/reference/androidx/core/graphics/RectKt#(android.graphics.RectF).toRect()(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/RectF.html receiver)` Returns a `https://developer.android.com/reference/android/graphics/Rect.html` representation of this rectangle. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/RectF.html` | `https://developer.android.com/reference/androidx/core/graphics/RectKt#(android.graphics.Rect).toRectF()(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Rect.html receiver)` Returns a `https://developer.android.com/reference/android/graphics/RectF.html` representation of this rectangle. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Region.html` | `https://developer.android.com/reference/androidx/core/graphics/RectKt#(android.graphics.Rect).toRegion()(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Rect.html receiver)` Returns a `https://developer.android.com/reference/android/graphics/Region.html` representation of this rectangle. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Region.html` | `https://developer.android.com/reference/androidx/core/graphics/RectKt#(android.graphics.RectF).toRegion()(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/RectF.html receiver)` Returns a `https://developer.android.com/reference/android/graphics/Region.html` representation of this rectangle. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/RectF.html` | `https://developer.android.com/reference/androidx/core/graphics/RectKt#(android.graphics.RectF).transform(android.graphics.Matrix)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/RectF.html receiver, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Matrix.html m)` Transform this rectangle in place using the supplied `https://developer.android.com/reference/android/graphics/Matrix.html` and returns this rectangle. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Region.html` | `https://developer.android.com/reference/androidx/core/graphics/RectKt#(android.graphics.Rect).xor(android.graphics.Rect)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Rect.html receiver, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Rect.html r)` Returns the union minus the intersection of two rectangles as a new region. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Region.html` | `https://developer.android.com/reference/androidx/core/graphics/RectKt#(android.graphics.RectF).xor(android.graphics.RectF)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/RectF.html receiver, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/RectF.html r)` Returns the union minus the intersection of two rectangles as a new region. |

## Public methods

### and

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/graphics/Rect.kt+function:and) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final @NonNull Rect and(@NonNull Rect receiver, @NonNull Rect r)
```

Returns the intersection of two rectangles as a new rectangle. If the rectangles do not intersect, returns a copy of the left hand side rectangle.

### and

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/graphics/Rect.kt+function:and) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final @NonNull RectF and(@NonNull RectF receiver, @NonNull RectF r)
```

Returns the intersection of two rectangles as a new rectangle. If the rectangles do not intersect, returns a copy of the left hand side rectangle.

### component1

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/graphics/Rect.kt+function:component1) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final int component1(@NonNull Rect receiver)
```

Returns "left", the first component of the rectangle.

This method allows to use destructuring declarations when working with rectangles, for example:

```
val (left, top, right, bottom) = myRectangle
```

### component1

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/graphics/Rect.kt+function:component1) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final float component1(@NonNull RectF receiver)
```

Returns "left", the first component of the rectangle.

This method allows to use destructuring declarations when working with rectangles, for example:

```
val (left, top, right, bottom) = myRectangle
```

### component2

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/graphics/Rect.kt+function:component2) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final int component2(@NonNull Rect receiver)
```

Returns "top", the second component of the rectangle.

This method allows to use destructuring declarations when working with rectangles, for example:

```
val (left, top, right, bottom) = myRectangle
```

### component2

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/graphics/Rect.kt+function:component2) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final float component2(@NonNull RectF receiver)
```

Returns "top", the second component of the rectangle.

This method allows to use destructuring declarations when working with rectangles, for example:

```
val (left, top, right, bottom) = myRectangle
```

### component3

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/graphics/Rect.kt+function:component3) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final int component3(@NonNull Rect receiver)
```

Returns "right", the third component of the rectangle.

This method allows to use destructuring declarations when working with rectangles, for example:

```
val (left, top, right, bottom) = myRectangle
```

### component3

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/graphics/Rect.kt+function:component3) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final float component3(@NonNull RectF receiver)
```

Returns "right", the third component of the rectangle.

This method allows to use destructuring declarations when working with rectangles, for example:

```
val (left, top, right, bottom) = myRectangle
```

### component4

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/graphics/Rect.kt+function:component4) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final int component4(@NonNull Rect receiver)
```

Returns "bottom", the fourth component of the rectangle.

This method allows to use destructuring declarations when working with rectangles, for example:

```
val (left, top, right, bottom) = myRectangle
```

### component4

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/graphics/Rect.kt+function:component4) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final float component4(@NonNull RectF receiver)
```

Returns "bottom", the fourth component of the rectangle.

This method allows to use destructuring declarations when working with rectangles, for example:

```
val (left, top, right, bottom) = myRectangle
```

### contains

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/graphics/Rect.kt+function:contains) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final boolean contains(@NonNull Rect receiver, @NonNull Point p)
```

Returns true if the specified point is inside the rectangle. The left and top are considered to be inside, while the right and bottom are not. This means that for a point to be contained: left \<= x \< right and top \<= y \< bottom. An empty rectangle never contains any point.

### contains

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/graphics/Rect.kt+function:contains) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final boolean contains(@NonNull RectF receiver, @NonNull PointF p)
```

Returns true if the specified point is inside the rectangle. The left and top are considered to be inside, while the right and bottom are not. This means that for a point to be contained: left \<= x \< right and top \<= y \< bottom. An empty rectangle never contains any point.

### minus

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/graphics/Rect.kt+function:minus) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final @NonNull Region minus(@NonNull Rect receiver, @NonNull Rect r)
```

Returns the difference of this rectangle and the specified rectangle as a new region.

### minus

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/graphics/Rect.kt+function:minus) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final @NonNull Rect minus(@NonNull Rect receiver, int xy)
```

Returns a new rectangle representing this rectangle offset by the negation of the specified amount on both X and Y axis.

### minus

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/graphics/Rect.kt+function:minus) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final @NonNull Rect minus(@NonNull Rect receiver, @NonNull Point xy)
```

Returns a new rectangle representing this rectangle offset by the negation of the specified point.

### minus

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/graphics/Rect.kt+function:minus) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final @NonNull Region minus(@NonNull RectF receiver, @NonNull RectF r)
```

Returns the difference of this rectangle and the specified rectangle as a new region. This rectangle is first converted to a `https://developer.android.com/reference/android/graphics/Rect.html` using `https://developer.android.com/reference/androidx/core/graphics/package-summary#(android.graphics.RectF).toRect()`.

### minus

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/graphics/Rect.kt+function:minus) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final @NonNull RectF minus(@NonNull RectF receiver, float xy)
```

Returns a new rectangle representing this rectangle offset by the negation of the specified amount on both X and Y axis.

### minus

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/graphics/Rect.kt+function:minus) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final @NonNull RectF minus(@NonNull RectF receiver, @NonNull PointF xy)
```

Returns a new rectangle representing this rectangle offset by the negation of the specified point.

### or

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/graphics/Rect.kt+function:or) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final @NonNull Rect or(@NonNull Rect receiver, @NonNull Rect r)
```

Returns the union of two rectangles as a new rectangle.

### or

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/graphics/Rect.kt+function:or) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final @NonNull RectF or(@NonNull RectF receiver, @NonNull RectF r)
```

Returns the union of two rectangles as a new rectangle.

### plus

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/graphics/Rect.kt+function:plus) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final @NonNull Rect plus(@NonNull Rect receiver, @NonNull Rect r)
```

Performs the union of this rectangle and the specified rectangle and returns the result as a new rectangle.

### plus

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/graphics/Rect.kt+function:plus) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final @NonNull Rect plus(@NonNull Rect receiver, int xy)
```

Returns a new rectangle representing this rectangle offset by the specified amount on both X and Y axis.

### plus

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/graphics/Rect.kt+function:plus) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final @NonNull Rect plus(@NonNull Rect receiver, @NonNull Point xy)
```

Returns a new rectangle representing this rectangle offset by the specified point.

### plus

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/graphics/Rect.kt+function:plus) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final @NonNull RectF plus(@NonNull RectF receiver, @NonNull RectF r)
```

Performs the union of this rectangle and the specified rectangle and returns the result as a new rectangle.

### plus

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/graphics/Rect.kt+function:plus) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final @NonNull RectF plus(@NonNull RectF receiver, float xy)
```

Returns a new rectangle representing this rectangle offset by the specified amount on both X and Y axis.

### plus

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/graphics/Rect.kt+function:plus) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final @NonNull RectF plus(@NonNull RectF receiver, @NonNull PointF xy)
```

Returns a new rectangle representing this rectangle offset by the specified point.

### times

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/graphics/Rect.kt+function:times) Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/core#1.2.0)

```
public static final @NonNull Rect times(@NonNull Rect receiver, int factor)
```

Returns a new rectangle representing this rectangle's components each scaled by `https://developer.android.com/reference/androidx/core/graphics/package-summary#(android.graphics.Rect).times(kotlin.Int)`.

### times

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/graphics/Rect.kt+function:times) Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/core#1.2.0)

```
public static final @NonNull RectF times(@NonNull RectF receiver, float factor)
```

Returns a new rectangle representing this rectangle's components each scaled by `https://developer.android.com/reference/androidx/core/graphics/package-summary#(android.graphics.RectF).times(kotlin.Float)`.

### times

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/graphics/Rect.kt+function:times) Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/core#1.2.0)

```
public static final @NonNull RectF times(@NonNull RectF receiver, int factor)
```

Returns a new rectangle representing this rectangle's components each scaled by `https://developer.android.com/reference/androidx/core/graphics/package-summary#(android.graphics.RectF).times(kotlin.Int)`.

### toRect

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/graphics/Rect.kt+function:toRect) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final @NonNull Rect toRect(@NonNull RectF receiver)
```

Returns a `https://developer.android.com/reference/android/graphics/Rect.html` representation of this rectangle. The resulting rect will be sized such that this rect can fit within it.

### toRectF

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/graphics/Rect.kt+function:toRectF) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final @NonNull RectF toRectF(@NonNull Rect receiver)
```

Returns a `https://developer.android.com/reference/android/graphics/RectF.html` representation of this rectangle.

### toRegion

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/graphics/Rect.kt+function:toRegion) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final @NonNull Region toRegion(@NonNull Rect receiver)
```

Returns a `https://developer.android.com/reference/android/graphics/Region.html` representation of this rectangle.

### toRegion

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/graphics/Rect.kt+function:toRegion) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final @NonNull Region toRegion(@NonNull RectF receiver)
```

Returns a `https://developer.android.com/reference/android/graphics/Region.html` representation of this rectangle. The resulting rect will be sized such that this rect can fit within it.

### transform

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/graphics/Rect.kt+function:transform) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final @NonNull RectF transform(@NonNull RectF receiver, @NonNull Matrix m)
```

Transform this rectangle in place using the supplied `https://developer.android.com/reference/android/graphics/Matrix.html` and returns this rectangle.

### xor

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/graphics/Rect.kt+function:xor) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final @NonNull Region xor(@NonNull Rect receiver, @NonNull Rect r)
```

Returns the union minus the intersection of two rectangles as a new region.

### xor

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/graphics/Rect.kt+function:xor) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final @NonNull Region xor(@NonNull RectF receiver, @NonNull RectF r)
```

Returns the union minus the intersection of two rectangles as a new region. The two rectangles are first converted to `https://developer.android.com/reference/android/graphics/Rect.html` using `https://developer.android.com/reference/androidx/core/graphics/package-summary#(android.graphics.RectF).toRect()`.