(
baseLayoutInfo: LabelGeometry | NullUndefined,
targetLayoutInfo: LabelGeometry | NullUndefined,
mtv?: PointLike,
intersectOpt?: BoundingRectIntersectOpt
)
| 584 | * Typically this method (and the entire layout process) is performed in normal state. |
| 585 | */ |
| 586 | export function labelIntersect( |
| 587 | baseLayoutInfo: LabelGeometry | NullUndefined, |
| 588 | targetLayoutInfo: LabelGeometry | NullUndefined, |
| 589 | mtv?: PointLike, |
| 590 | intersectOpt?: BoundingRectIntersectOpt |
| 591 | ): boolean { |
| 592 | if (!baseLayoutInfo || !targetLayoutInfo) { |
| 593 | return false; |
| 594 | } |
| 595 | if ((baseLayoutInfo.label && baseLayoutInfo.label.ignore) |
| 596 | || (targetLayoutInfo.label && targetLayoutInfo.label.ignore) |
| 597 | ) { |
| 598 | return false; |
| 599 | } |
| 600 | // Fast rejection. |
| 601 | if (!baseLayoutInfo.rect.intersect(targetLayoutInfo.rect, mtv, intersectOpt)) { |
| 602 | return false; |
| 603 | } |
| 604 | if (baseLayoutInfo.axisAligned && targetLayoutInfo.axisAligned) { |
| 605 | return true; // obb is the same as the normal bounding rect. |
| 606 | } |
| 607 | return ensureOBB(baseLayoutInfo).intersect(ensureOBB(targetLayoutInfo), mtv, intersectOpt); |
| 608 | } |
no test coverage detected
searching dependent graphs…