MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / toScreen

Function toScreen

graph-ui/src/galaxy/HierarchyEdgeLabels.tsx:132–135  ·  view source on GitHub ↗
(x: number, y: number, z = 0)

Source from the content-addressed store, hash-verified

130 if (tick.current !== 0) return;
131 const box = gl.domElement.getBoundingClientRect();
132 const toScreen = (x: number, y: number, z = 0) => {
133 point.set(x, y, z).project(camera);
134 return { x: box.left + ((point.x + 1) / 2) * box.width, y: box.top + ((1 - point.y) / 2) * box.height };
135 };
136 const blockers: ScreenRect[] = (nameBoxes.current ?? []).map((name) => {
137 const a = toScreen(name.x - name.width / 2, name.y + name.height / 2), b = toScreen(name.x + name.width / 2, name.y - name.height / 2);
138 return { left: Math.min(a.x, b.x), right: Math.max(a.x, b.x), top: Math.min(a.y, b.y), bottom: Math.max(a.y, b.y) };

Callers 1

HierarchyEdgeLabelsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected