(item, bpCols)
| 14 | } |
| 15 | |
| 16 | function clampItemToGrid(item, bpCols) { |
| 17 | const clamped = cloneDeep(item); |
| 18 | if (clamped.w > bpCols) clamped.w = bpCols; |
| 19 | if (clamped.x < 0) clamped.x = 0; |
| 20 | if (clamped.y < 0) clamped.y = 0; |
| 21 | if (clamped.x + clamped.w > bpCols) { |
| 22 | clamped.x = Math.max(0, bpCols - clamped.w); |
| 23 | } |
| 24 | return clamped; |
| 25 | } |
| 26 | |
| 27 | function findLeftmostX(item, placed, bpCols) { |
| 28 | let x = 0; |
no outgoing calls
no test coverage detected