(box1: BoundingBox, box2: BoundingBox, margin = 0)
| 307 | * Checks if two bounding boxes overlap (with optional margin) |
| 308 | */ |
| 309 | export function boxesOverlap(box1: BoundingBox, box2: BoundingBox, margin = 0): boolean { |
| 310 | return !( |
| 311 | box1.x + box1.width + margin <= box2.x || |
| 312 | box2.x + box2.width + margin <= box1.x || |
| 313 | box1.y + box1.height + margin <= box2.y || |
| 314 | box2.y + box2.height + margin <= box1.y |
| 315 | ) |
| 316 | } |
| 317 | |
| 318 | /** |
| 319 | * Resolves the on-canvas dimensions of a note block. |
no outgoing calls
no test coverage detected