Compose API Reference Compose UI Geometry toRect Function Common fun MutableRect.toRect(): Rect Common fun Size.toRect(): Rect Convert a Size to a Rect.