UNPKG

542 BTypeScriptView Raw
1import { BBox } from '../dependents';
2declare type Box = Pick<BBox, 'x' | 'y' | 'width' | 'height'> & {
3 rotation?: number;
4};
5/**
6 * 快速判断两个无旋转矩形是否遮挡
7 */
8export declare function isIntersectRect(box1: Box, box2: Box, margin?: number): boolean;
9/**
10 * detect whether two shape is intersected, useful when shape is been rotated
11 * 判断两个矩形是否重叠(相交和包含, 是否旋转)
12 *
13 * - 原理: 分离轴定律
14 */
15export declare function isIntersect(box1: Box, box2: Box): boolean;
16export {};