feat: multi-material overlays, presentation guides, and release prebuilds
Align control/presentation with presentation screen rect and darkness z-order; sync window titles and session window cleanup. Pack Win/Mac/Linux with npmRebuild disabled and release-native-prep for classic-level and sharp. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
/** Вписать прямоугольник целевого аспекта в бокс (как object-fit: contain). */
|
||||
export function fitAspectRect(
|
||||
boxW: number,
|
||||
boxH: number,
|
||||
aspectW: number,
|
||||
aspectH: number,
|
||||
): { x: number; y: number; w: number; h: number } {
|
||||
const bw = Math.max(1, boxW);
|
||||
const bh = Math.max(1, boxH);
|
||||
const aw = Math.max(1, aspectW);
|
||||
const ah = Math.max(1, aspectH);
|
||||
const boxAspect = bw / bh;
|
||||
const targetAspect = aw / ah;
|
||||
if (boxAspect > targetAspect) {
|
||||
const h = bh;
|
||||
const w = h * targetAspect;
|
||||
return { x: (bw - w) / 2, y: 0, w, h };
|
||||
}
|
||||
const w = bw;
|
||||
const h = w / targetAspect;
|
||||
return { x: 0, y: (bh - h) / 2, w, h };
|
||||
}
|
||||
Reference in New Issue
Block a user