all

视频

视频

视频

视频

视频

init
This commit is contained in:
LKH committed 2026-07-29 09:17:00 +08:00
commit 3b053c714c
128 files changed
+31559

No files matched your search

@@ -0,0 +1,18 @@
import { describe, expect, it } from "vitest";
import { fitFrameWithinViewport } from "./viewportAspectFrame";
describe("fitFrameWithinViewport", () => {
it("keeps framed aspect layouts inside the visible safe area between overlay side panels", () => {
const frame = fitFrameWithinViewport(1000, 700, 16 / 9, 126, {
left: 220,
right: 300,
top: 0,
bottom: 0,
});
expect(frame.left).toBeGreaterThanOrEqual(260);
expect(frame.left + frame.width).toBeLessThanOrEqual(660);
expect(frame.top).toBeGreaterThanOrEqual(40);
expect(frame.top + frame.height).toBeLessThanOrEqual(574);
});
});