LinearLayoutProvider
Defined in: ui/collection/layout-provider.ts:38
Abstract layout math for a virtualized list. Implementations answer three questions for a list of fixed-size items:
- how big is the total content?
- where does item
isit inside that content? - which index range is visible in the given viewport?
Variable-height items can be added later via an optional measure callback; this revision assumes fixed-size items.
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new LinearLayoutProvider(
opts):LinearLayoutProvider
Defined in: ui/collection/layout-provider.ts:43
Parameters
Section titled “Parameters”LinearLayoutOptions
Returns
Section titled “Returns”LinearLayoutProvider
Methods
Section titled “Methods”getContentSize()
Section titled “getContentSize()”getContentSize(
count):Vec2
Defined in: ui/collection/layout-provider.ts:49
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”Implementation of
Section titled “Implementation of”getItemRect()
Section titled “getItemRect()”getItemRect(
index):Rect
Defined in: ui/collection/layout-provider.ts:58
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”Rect
Implementation of
Section titled “Implementation of”getVisibleRange()
Section titled “getVisibleRange()”getVisibleRange(
viewport,count): [number,number]
Defined in: ui/collection/layout-provider.ts:66
Inclusive start, exclusive end. Returns [0, 0] when nothing is visible.
Parameters
Section titled “Parameters”viewport
Section titled “viewport”Rect
number
Returns
Section titled “Returns”[number, number]