# RelativeLayoutBounds

Artifact: [androidx.compose.ui:ui](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/spatial/RelativeLayoutBounds.kt+class:androidx.compose.ui.spatial.RelativeLayoutBounds) Added in [1.8.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.8.0) Common/All
- Cmn

  ```
  class RelativeLayoutBounds
  ```

*** ** * ** ***

Represents an axis-aligned bounding Rectangle for an element in a compose hierarchy, in the coordinates of either the Root of the compose hierarchy, the Window, or the Screen.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/layout/onLayoutRectChanged.modifier#(androidx.compose.ui.Modifier).onLayoutRectChanged(kotlin.Long,kotlin.Long,kotlin.Function1)` |   |

## Summary

| ### Public functions |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntRect>` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/spatial/RelativeLayoutBounds#calculateOcclusions()()` At the current state of the layout, calculates which other Composable Layouts are occluding the Composable associated with this `https://developer.android.com/reference/kotlin/androidx/compose/ui/spatial/RelativeLayoutBounds`. | Cmn |
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/spatial/RelativeLayoutBounds#equals(kotlin.Any)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/spatial/RelativeLayoutBounds#fractionVisibleIn(androidx.compose.ui.spatial.RelativeLayoutBounds)(viewport: https://developer.android.com/reference/kotlin/androidx/compose/ui/spatial/RelativeLayoutBounds)` Used to determine the fraction of pixels that are inside the bounds of the `https://developer.android.com/reference/kotlin/androidx/compose/ui/spatial/RelativeLayoutBounds#fractionVisibleIn(androidx.compose.ui.spatial.RelativeLayoutBounds)`. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/spatial/RelativeLayoutBounds#fractionVisibleInRect(kotlin.Int,kotlin.Int,kotlin.Int,kotlin.Int)(left: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, top: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, right: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, bottom: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Used to determine the fraction of pixels that are inside the provided rectangle. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/spatial/RelativeLayoutBounds#fractionVisibleInWindow()()` Used to determine the fraction of pixels that are inside the bounds of the window. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/spatial/RelativeLayoutBounds#fractionVisibleInWindowWithInsets(androidx.compose.ui.unit.IntOffset,androidx.compose.ui.unit.IntOffset)( topLeftInset: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntOffset, bottomRightInset: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntOffset )` Used to determine the fraction of pixels that are inside the rectangle defined by the window with the provided insets subtracted. | Cmn |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/spatial/RelativeLayoutBounds#hashCode()()` | Cmn |

| ### Public properties |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntRect` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/spatial/RelativeLayoutBounds#boundsInRoot()` The positioned bounding Rect in the coordinates of the root node of the compose hierarchy. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntRect` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/spatial/RelativeLayoutBounds#boundsInScreen()` The positioned bounding Rect in the coordinates of the Screen which it is contained in. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntRect` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/spatial/RelativeLayoutBounds#boundsInWindow()` The positioned bounding Rect in the coordinates of the Window which it is contained in. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/spatial/RelativeLayoutBounds#height()` The height, in pixels, of the Rect | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntOffset` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/spatial/RelativeLayoutBounds#positionInRoot()` The top left position of the Rect in the coordinates of the root node of the compose hierarchy. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntOffset` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/spatial/RelativeLayoutBounds#positionInScreen()` The top left position of the Rect in the coordinates of the Screen it is contained in. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntOffset` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/spatial/RelativeLayoutBounds#positionInWindow()` The top left position of the Rect in the coordinates of the Window it is contained in | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/spatial/RelativeLayoutBounds#width()` The width, in pixels, of the Rect | Cmn |

## Public functions

### calculateOcclusions

Cmn Added in [1.8.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.8.0)

```
fun calculateOcclusions(): List<IntRect>
```

At the current state of the layout, calculates which other Composable Layouts are occluding the Composable associated with this `https://developer.android.com/reference/kotlin/androidx/compose/ui/spatial/RelativeLayoutBounds`. **Note**: Calling this method during measure or layout may result on calculations with stale (or partially stale) layout information.

An occlusion is defined by an intersecting Composable that may draw on top of the target Composable.

There's no guarantee that something was actually drawn to occlude, so a transparent Composable that could otherwise draw on top of the target is considered to be occluding.

There's no differentiation between partial and complete occlusions, they are all included as part of this calculation.

Ancestors, child and grandchild Layouts are never considered to be occluding.

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntRect>` | A `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html` of the rectangles that occlude the associated Composable Layout. |

### equals

Cmn

```
open operator fun equals(other: Any?): Boolean
```

### fractionVisibleIn

Cmn Added in [1.9.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.9.0)

```
fun fractionVisibleIn(viewport: RelativeLayoutBounds): Float
```

Used to determine the fraction of pixels that are inside the bounds of the `https://developer.android.com/reference/kotlin/androidx/compose/ui/spatial/RelativeLayoutBounds#fractionVisibleIn(androidx.compose.ui.spatial.RelativeLayoutBounds)`.

If the `https://developer.android.com/reference/kotlin/androidx/compose/ui/spatial/RelativeLayoutBounds#fractionVisibleIn(androidx.compose.ui.spatial.RelativeLayoutBounds)` is entirely contained inside of the bounds, this method will return 1f. Otherwise, this will return the fraction of pixels of this element that are contained inside the `https://developer.android.com/reference/kotlin/androidx/compose/ui/spatial/RelativeLayoutBounds#fractionVisibleIn(androidx.compose.ui.spatial.RelativeLayoutBounds)` bounds.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/spatial/RelativeLayoutBounds#fractionVisibleInWindow()` |   |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/spatial/RelativeLayoutBounds#fractionVisibleInRect(kotlin.Int,kotlin.Int,kotlin.Int,kotlin.Int)` |   |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/spatial/RelativeLayoutBounds#fractionVisibleInWindowWithInsets(androidx.compose.ui.unit.IntOffset,androidx.compose.ui.unit.IntOffset)` |   |

### fractionVisibleInRect

Cmn Added in [1.9.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.9.0)

```
fun fractionVisibleInRect(left: Int, top: Int, right: Int, bottom: Int): Float
```

Used to determine the fraction of pixels that are inside the provided rectangle.

If the rectangle is entirely contained inside of the bounds, this method will return 1f. Otherwise, this will return the fraction of pixels of this element that are contained inside the rectangle.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/spatial/RelativeLayoutBounds#fractionVisibleInWindow()` |   |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/spatial/RelativeLayoutBounds#fractionVisibleIn(androidx.compose.ui.spatial.RelativeLayoutBounds)` |   |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/spatial/RelativeLayoutBounds#fractionVisibleInWindowWithInsets(androidx.compose.ui.unit.IntOffset,androidx.compose.ui.unit.IntOffset)` |   |

### fractionVisibleInWindow

Cmn Added in [1.9.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.9.0)

```
fun fractionVisibleInWindow(): Float
```

Used to determine the fraction of pixels that are inside the bounds of the window.

If the window is entirely contained inside of the bounds, this method will return 1f. Otherwise, this will return the fraction of pixels of this element that are contained inside the rectangle.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/spatial/RelativeLayoutBounds#fractionVisibleInWindow()` |   |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/spatial/RelativeLayoutBounds#fractionVisibleIn(androidx.compose.ui.spatial.RelativeLayoutBounds)` |   |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/spatial/RelativeLayoutBounds#fractionVisibleInWindowWithInsets(androidx.compose.ui.unit.IntOffset,androidx.compose.ui.unit.IntOffset)` |   |

### fractionVisibleInWindowWithInsets

Cmn Added in [1.10.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.10.0)

```
fun fractionVisibleInWindowWithInsets(
    topLeftInset: IntOffset,
    bottomRightInset: IntOffset
): Float
```

Used to determine the fraction of pixels that are inside the rectangle defined by the window with the provided insets subtracted.

If the rectangle is entirely contained inside of the bounds, this method will return 1f. Otherwise, this will return the fraction of pixels of this element that are contained inside the rectangle.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/spatial/RelativeLayoutBounds#fractionVisibleInWindow()` |   |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/spatial/RelativeLayoutBounds#fractionVisibleIn(androidx.compose.ui.spatial.RelativeLayoutBounds)` |   |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/spatial/RelativeLayoutBounds#fractionVisibleInWindowWithInsets(androidx.compose.ui.unit.IntOffset,androidx.compose.ui.unit.IntOffset)` |   |

### hashCode

Cmn

```
open fun hashCode(): Int
```

## Public properties

### boundsInRoot

Cmn Added in [1.8.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.8.0)

```
val boundsInRoot: IntRect
```

The positioned bounding Rect in the coordinates of the root node of the compose hierarchy.

### boundsInScreen

Cmn Added in [1.8.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.8.0)

```
val boundsInScreen: IntRect
```

The positioned bounding Rect in the coordinates of the Screen which it is contained in.

### boundsInWindow

Cmn Added in [1.8.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.8.0)

```
val boundsInWindow: IntRect
```

The positioned bounding Rect in the coordinates of the Window which it is contained in.

### height

Cmn Added in [1.8.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.8.0)

```
val height: Int
```

The height, in pixels, of the Rect

### positionInRoot

Cmn Added in [1.8.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.8.0)

```
val positionInRoot: IntOffset
```

The top left position of the Rect in the coordinates of the root node of the compose hierarchy.

### positionInScreen

Cmn Added in [1.8.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.8.0)

```
val positionInScreen: IntOffset
```

The top left position of the Rect in the coordinates of the Screen it is contained in.

### positionInWindow

Cmn Added in [1.8.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.8.0)

```
val positionInWindow: IntOffset
```

The top left position of the Rect in the coordinates of the Window it is contained in

### width

Cmn Added in [1.8.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.8.0)

```
val width: Int
```

The width, in pixels, of the Rect