Skip to content

MeasuredLinearLayoutProvider

Defined in: ui/collection/layout-provider.ts:109

A linear list whose items vary along the main axis (e.g. chat bubbles that grow with their wrapped text). Item offsets are prefix-summed and cached; the cache rebuilds when the item count changes or invalidate is called (a data or measurement change — the ListView invalidates on both). mainSizeOf is the app’s measure hook, so the list stays measurement-agnostic.

new MeasuredLinearLayoutProvider(opts): MeasuredLinearLayoutProvider

Defined in: ui/collection/layout-provider.ts:119

MeasuredLinearLayoutOptions

MeasuredLinearLayoutProvider

getContentSize(count): Vec2

Defined in: ui/collection/layout-provider.ts:144

number

Vec2

LayoutProvider.getContentSize


getItemRect(index): Rect

Defined in: ui/collection/layout-provider.ts:151

number

Rect

LayoutProvider.getItemRect


getVisibleRange(viewport, count): [number, number]

Defined in: ui/collection/layout-provider.ts:160

Inclusive start, exclusive end. Returns [0, 0] when nothing is visible.

Rect

number

[number, number]

LayoutProvider.getVisibleRange


invalidate(): void

Defined in: ui/collection/layout-provider.ts:127

Re-measure on the next query (an item’s data/size changed, not just the count).

void