in src/shapes/shapes.ts [182:194]
export function isIntersecting(rect1: IRect, rect2: IRect): boolean {
if (!rect1 || !rect2) {
return false;
}
let left = Math.max(rect1.left, rect2.left);
let right = Math.min(rect1.left + rect1.width, rect2.left + rect2.width);
if (left > right) {
return false;
}
let top = Math.max(rect1.top, rect2.top);
let bottom = Math.min(rect1.top + rect1.height, rect2.top + rect2.height);
return top <= bottom;
}