Interface

RulerScope

A scope used in [MeasureScope.

RulerProducerUsage

@Composable
fun RulerProducerUsage(content: @Composable BoxScope.() -> Unit) {
    val safeInsets = WindowInsets.safeContent
    Box(
        Modifier.fillMaxSize().layout { measurable, constraints ->
            val placeable = measurable.measure(constraints)
            layout(
                width = placeable.width,
                height = placeable.height,
                rulers = {
                    val height = coordinates.size.height
                    SafeBottomRuler provides (height - safeInsets.getBottom(this)).toFloat()
                },
            ) {
                placeable.place(0, 0)
            }
        },
        content = content,
    )
}