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

Function frameFill

graph-ui/src/galaxy/camera-frame.ts:166–180  ·  view source on GitHub ↗
(
    box: FrameBox,
    distance: number,
    fovDegrees: number,
    aspect: number,
)

Source from the content-addressed store, hash-verified

164}
165
166export function frameFill(
167 box: FrameBox,
168 distance: number,
169 fovDegrees: number,
170 aspect: number,
171): { vertical: number; horizontal: number } {
172 const fov = (Math.max(1, Math.min(179, fovDegrees)) * Math.PI) / 180;
173 const safeAspect = Number.isFinite(aspect) && aspect > 0 ? aspect : 1;
174 const visibleHeight = 2 * Math.max(FRAME_MIN_DISTANCE, distance) * Math.tan(fov / 2);
175 const visibleWidth = visibleHeight * safeAspect;
176 return {
177 vertical: visibleHeight === 0 ? 0 : Math.max(0, box.height) / visibleHeight,
178 horizontal: visibleWidth === 0 ? 0 : Math.max(0, box.width) / visibleWidth,
179 };
180}
181
182/* ------------------------------------------- die Ausrichtung (W10b, AC5) --- */
183

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected