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

Function labelInset

graph-ui/src/architecture/label-space.ts:18–22  ·  view source on GitHub ↗
(boxes: Iterable<LabelBox>)

Source from the content-addressed store, hash-verified

16 * reach the text of either.
17 */
18export function labelInset(boxes: Iterable<LabelBox>): [number, number] {
19 let x = Infinity, y = Infinity;
20 for (const box of boxes) { x = Math.min(x, box.edgeX); y = Math.min(y, box.edgeY); }
21 return [Number.isFinite(x) ? x / 2 : 0, Number.isFinite(y) ? y / 2 : 0];
22}
23
24/** The space a label centred at (x, y) claims; a negative inset keeps a margin around an estimate. */
25export function labelRect(x: number, y: number, width: number, height: number, [insetX, insetY]: [number, number]): LabelRect {

Callers 2

SceneLabelsFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected