MCPcopy Create free account
hub / github.com/thetarnav/solid-devtools / getVirtualVars

Function getVirtualVars

packages/frontend/src/structure.tsx:309–325  ·  view source on GitHub ↗
(
    listLength: number,
    scroll: number,
    containerHeight: number,
    rowHeight: number,
)

Source from the content-addressed store, hash-verified

307export const padding_mask = `linear-gradient(to right, rgba(0,0,0, 0.4), black ${theme.spacing[48]})`
308
309export 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
327const StructureContext = s.createContext<Module>()
328

Callers 2

virtual.test.tsFile · 0.90
DisplayStructureTreeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…