MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / rowsInRange

Function rowsInRange

ui/src/lib/filecode-model.ts:338–349  ·  view source on GitHub ↗
(
  rows: readonly FileCallRow[],
  from: number,
  to: number
)

Source from the content-addressed store, hash-verified

336
337/** The rows whose boxes intersect a pixel range. Rows are sorted by `top`. */
338export 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. */
352export function railHeight(rows: readonly FileCallRow[]): number {

Callers 1

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected