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

Function labelRect

graph-ui/src/architecture/label-space.ts:25–27  ·  view source on GitHub ↗
(x: number, y: number, width: number, height: number, [insetX, insetY]: [number, number])

Source from the content-addressed store, hash-verified

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 {
26 return { left: x - width / 2 + insetX, right: x + width / 2 - insetX, top: y - height / 2 + insetY, bottom: y + height / 2 - insetY };
27}
28
29export const labelsCollide = (a: LabelRect, b: LabelRect): boolean =>
30 a.left < b.right && a.right > b.left && a.top < b.bottom && a.bottom > b.top;

Callers 3

placeFunction · 0.85
journeyChipFormFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected