ScrollState

class ScrollState(val dragScroll: DragScrollOptions, initialOffset: Double = 0.0)(source)

Caller-owned mutable position shared by a scroll area and zero or more independent scrollbars.

Reads, writes, runtime observation, and subscription release are confined to the construction execution owner. Area attachment publishes viewport and content geometry, while application calls may request positions before or after attachment. Requested positions are clamped whenever current geometry is known. The state owns no retained nodes and does not own its observers.

Parameters

initialOffset

initial non-negative finite logical displacement.

Constructors

Link copied to clipboard
constructor(dragScroll: DragScrollOptions, initialOffset: Double = 0.0)
constructor(initialOffset: Double = 0.0)

Creates navigation state with the standard touch-style content-drag policy. Existing JVM constructor entry points remain available.

Properties

Link copied to clipboard

immutable content-drag policy; retain this state outside reevaluated content.

Link copied to clipboard

Current immutable geometry and position snapshot.

Functions

Link copied to clipboard

Installs one runtime observer and returns its owner-confined idempotent release handle.

Link copied to clipboard
fun scrollBy(delta: Double): Double

Moves by delta logical pixels and returns the resulting offset.

Moves from a runtime input handler while suppressing feedback to its originating node.

Link copied to clipboard
fun scrollTo(offset: Double): Double

Moves to offset logical pixels and returns the clamped resulting offset.

fun scrollTo(offset: Double, origin: ScrollStateObserver): Double

Moves from a runtime input handler while suppressing feedback to its originating node.

Link copied to clipboard
fun updateGeometry(viewportExtent: Int, contentExtent: Int, origin: ScrollStateObserver)

Publishes measured geometry while suppressing feedback to the originating area observer.