( rows: readonly FileCallRow[], from: number, to: number )
| 336 | |
| 337 | /** The rows whose boxes intersect a pixel range. Rows are sorted by `top`. */ |
| 338 | export function rowsInRange( |
| 339 | rows: readonly FileCallRow[], |
| 340 | from: number, |
| 341 | to: number |
| 342 | ): FileCallRow[] { |
| 343 | const out: FileCallRow[] = []; |
| 344 | for (const row of rows) { |
| 345 | if (row.top > to) break; |
| 346 | if (row.top + ROW_HEIGHT >= from) out.push(row); |
| 347 | } |
| 348 | return out; |
| 349 | } |
| 350 | |
| 351 | /** Height the rail needs, so the document never ends above its last row. */ |
| 352 | export function railHeight(rows: readonly FileCallRow[]): number { |
no test coverage detected