(items, pad)
| 120201 | // including padding pixels of separation |
| 120202 | const intersect = (a, b, sep)=>sep > Math.max(b.x1 - a.x2, a.x1 - b.x2, b.y1 - a.y2, a.y1 - b.y2); |
| 120203 | const hasOverlap = (items, pad)=>{ |
| 120204 | for(var i = 1, n = items.length, a = items[0].bounds, b; i < n; a = b, ++i){ |
| 120205 | if (intersect(a, b = items[i].bounds, pad)) return true; |
| 120206 | } |
| 120207 | }; |
| 120208 | const hasBounds = (item)=>{ |
| 120209 | const b = item.bounds; |
| 120210 | return b.width() > 1 && b.height() > 1; |