computeTotalContentHeight

Computes the content height without a trailing row gap

Available since @roku-sdk/flex-grid 3.3.0

import { computeTotalContentHeight } from "@roku-sdk/flex-grid/geometry";

Also exported as computeTotalContentHeight from @roku-sdk/flex-grid (deprecated).

Deprecated: computeTotalContentHeight. Import from @roku-sdk/flex-grid/geometry instead. The root export will be removed in the next major version.

computeTotalContentHeight(params: FixedFocusYParams): number

Description

Computes the content height without a trailing row gap.

Zero rows returns zero without calling either row accessor. Row indices are zero-based; positions and heights must describe the same content coordinate system.

Parameters

NameTypeDescription
paramsFixedFocusYParamsRow geometry with positions and heights in pixels.

Return values

The last row start plus its height in pixels, or zero for no rows.

Example

computeTotalContentHeight({ containerY: 0, viewportHeight: 200, numRows: 2, getRowY: r => r * 100, getRowHeight: () => 100 }); // 200

Did this page help you?