( layout: Layout, layoutItem: LayoutItem )
| 38 | * @returns The first colliding item, or undefined if none |
| 39 | */ |
| 40 | export function getFirstCollision( |
| 41 | layout: Layout, |
| 42 | layoutItem: LayoutItem |
| 43 | ): LayoutItem | undefined { |
| 44 | for (let i = 0; i < layout.length; i++) { |
| 45 | const item = layout[i]; |
| 46 | if (item !== undefined && collides(item, layoutItem)) { |
| 47 | return item; |
| 48 | } |
| 49 | } |
| 50 | return undefined; |
| 51 | } |
| 52 | |
| 53 | /** |
| 54 | * Find all items in the layout that collide with the given item. |
no test coverage detected
searching dependent graphs…