boundsInWindow

Function

Common

Deprecated Deprecated in favor of boundsInWindow with clipBounds parameter

fun LayoutCoordinates.boundsInWindow(): Rect
Common
fun LayoutCoordinates.boundsInWindow(clipBounds: Boolean = true): Rect

The boundaries of this layout relative to the window's origin.

Parameters

clipBoundsWhether to clip the bounds of the layout to the window's boundaries. If true, any clipping that occurs between this layout and the window will affect the returned bounds, and can even result in an empty rectangle if clipped regions do not overlap. If false, the bounding box of this layout will be converted to window coordinates irrespective of any clipping applied. Defaults to true.

Returns

A Rect representing the bounding box of this LayoutCoordinates in the window's coordinate space. If the bounds are completely clipped, returns Rect.Zero.