in src/visual.ts [536:567]
private isIntersect(textRect1: ITextRect, textRect2: ITextRect): boolean {
let intersectY: boolean = false;
let intersectX: boolean = false;
if (textRect1.y1 <= textRect2.y1 && textRect2.y1 <= textRect1.y2) {
intersectY = true;
}
if (textRect1.y1 <= textRect2.y2 && textRect2.y2 <= textRect1.y2) {
intersectY = true;
}
if (textRect2.y2 <= textRect1.y1 && textRect1.y1 <= textRect2.y1) {
intersectY = true;
}
if (textRect2.y2 <= textRect1.y2 && textRect1.y2 <= textRect2.y1) {
intersectY = true;
}
if (textRect1.x1 <= textRect2.x1 && textRect2.x1 <= textRect1.x2) {
intersectX = true;
}
if (textRect1.x1 <= textRect2.x2 && textRect2.x2 <= textRect1.x2) {
intersectX = true;
}
if (textRect2.x2 <= textRect1.x1 && textRect1.x1 <= textRect2.x1) {
intersectX = true;
}
if (textRect2.x2 <= textRect1.x2 && textRect1.x2 <= textRect2.x1) {
intersectX = true;
}
return intersectX && intersectY;
}