GridLayoutProvider
Defined in: ui/collection/layout-provider.ts:183
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 GridLayoutProvider(
opts):GridLayoutProvider
Defined in: ui/collection/layout-provider.ts:188
Parameters
Section titled “Parameters”GridLayoutOptions
Returns
Section titled “Returns”GridLayoutProvider
Methods
Section titled “Methods”getContentSize()
Section titled “getContentSize()”getContentSize(
count):Vec2
Defined in: ui/collection/layout-provider.ts:194
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:202
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:213
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]