(cell1, cell2)
| 49 | } |
| 50 | |
| 51 | function cellsConflict(cell1, cell2) { |
| 52 | let yMin1 = cell1.y; |
| 53 | let yMax1 = cell1.y - 1 + (cell1.rowSpan || 1); |
| 54 | let yMin2 = cell2.y; |
| 55 | let yMax2 = cell2.y - 1 + (cell2.rowSpan || 1); |
| 56 | let yConflict = !(yMin1 > yMax2 || yMin2 > yMax1); |
| 57 | |
| 58 | let xMin1 = cell1.x; |
| 59 | let xMax1 = cell1.x - 1 + (cell1.colSpan || 1); |
| 60 | let xMin2 = cell2.x; |
| 61 | let xMax2 = cell2.x - 1 + (cell2.colSpan || 1); |
| 62 | let xConflict = !(xMin1 > xMax2 || xMin2 > xMax1); |
| 63 | |
| 64 | return yConflict && xConflict; |
| 65 | } |
| 66 | |
| 67 | function conflictExists(rows, x, y) { |
| 68 | let i_max = Math.min(rows.length - 1, y); |
no outgoing calls
no test coverage detected
searching dependent graphs…