buildCumY
Builds cumulative vertical positions for rows with different heights
Available since @roku-sdk/flex-grid 3.3.0
import { buildCumY } from "@roku-sdk/flex-grid/geometry";Also exported as buildCumY from @roku-sdk/flex-grid (deprecated).
Deprecated: buildCumY. Import from @roku-sdk/flex-grid/geometry instead. The root export will be removed in the next major version.
buildCumY(rowHeights: number[], rowGap: number): number[]Description
Builds cumulative vertical positions for rows with different heights.
Rows with zero height contribute no gap. An empty height array returns [0]. Heights and the gap must be non-negative. The final entry includes the gap after the last non-empty row.
Parameters
| Name | Type | Description |
|---|---|---|
rowHeights | number[] | Row heights in pixels, in data-row order. |
rowGap | number | Gap after each non-empty row in pixels. |
Return values
The row start positions in pixels followed by the total extent including any trailing gap.
Example
buildCumY([100, 0, 200], 10); // [0, 110, 110, 320]Updated about 6 hours ago
What’s Next
Did this page help you?