(
listLength: number,
scroll: number,
containerHeight: number,
rowHeight: number,
)
| 307 | export const padding_mask = `linear-gradient(to right, rgba(0,0,0, 0.4), black ${theme.spacing[48]})` |
| 308 | |
| 309 | export function getVirtualVars( |
| 310 | listLength: number, |
| 311 | scroll: number, |
| 312 | containerHeight: number, |
| 313 | rowHeight: number, |
| 314 | ): {start: number; end: number; length: number} { |
| 315 | let start = Math.floor(scroll / rowHeight) |
| 316 | let length = Math.ceil(containerHeight / rowHeight + 1) |
| 317 | let end = start + length |
| 318 | if (end > listLength) { |
| 319 | end = listLength |
| 320 | start = end - length |
| 321 | length = Math.min(length, listLength) |
| 322 | if (start < 0) start = 0 |
| 323 | } |
| 324 | return {start, end, length} |
| 325 | } |
| 326 | |
| 327 | const StructureContext = s.createContext<Module>() |
| 328 |
no outgoing calls
no test coverage detected
searching dependent graphs…