L-Sun
2025-04-21 11:01:04 +00:00
parent e46ae2f721
commit a2b40fea20
9 changed files with 283 additions and 33 deletions

View File

@@ -1942,3 +1942,12 @@ export async function waitFontsLoaded(page: Page) {
return edgelessBlock.fontLoader?.ready;
});
}
export function isIntersected(
bound1: [number, number, number, number],
bound2: [number, number, number, number]
) {
const [x1, y1, w1, h1] = bound1;
const [x2, y2, w2, h2] = bound2;
return x1 < x2 + w2 && x1 + w1 > x2 && y1 < y2 + h2 && y1 + h1 > y2;
}