@devries-cameron20 / t3code Mirror · read-only
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 04:45 UTC

main
ts 8 lines 414 Bytes
Raw
1 export function fitDeviceFrame(aspect: number, width: number, height: number, rightInset: number) {
2 const availableWidth = Math.max(0, width - rightInset);
3 if (availableWidth === 0 || height === 0) return { width: 0, height: 0 };
4 const byHeight = { width: height * aspect, height };
5 return byHeight.width <= availableWidth
6 ? byHeight
7 : { width: availableWidth, height: availableWidth / aspect };
8 }