Skip to content

SlotClipSource

A layout-synchronous (non-Compose-state) holder for a Scrollable's current clip bounds.

The Scrollable updates bounds directly from its onGloballyPositioned/onSizeChanged callbacks, which fire every layout pass regardless of composition state. A descendant Slot reads bounds live, from its own onGloballyPositioned callback, at the same layout-pass granularity as SlotGroup.pos. Using androidx.compose.runtime.mutableStateOf here instead would only propagate the new value on the next recomposition - a composition-cycle lag behind position tracking that let a slot's clip bounds go stale exactly when the surrounding layout had just finished settling into a new position.

Constructors

SlotClipSource

constructor()

Properties

bounds

var bounds: IntRect?

Functions

updateOrigin

fun updateOrigin(newOrigin: IntCoordinates)

updateSize

fun updateSize(newSize: Size)