(layout: Layout, _cols: number)
| 180 | allowOverlap: false, |
| 181 | |
| 182 | compact(layout: Layout, _cols: number): Layout { |
| 183 | const compareWith = getStatics(layout); |
| 184 | let maxY = bottom(compareWith); |
| 185 | const sorted = sortLayoutItemsByRowCol(layout); |
| 186 | const out: LayoutItem[] = new Array(layout.length); |
| 187 | |
| 188 | for (let i = 0; i < sorted.length; i++) { |
| 189 | const sortedItem = sorted[i]; |
| 190 | if (sortedItem === undefined) continue; |
| 191 | |
| 192 | let l = cloneLayoutItem(sortedItem); |
| 193 | |
| 194 | if (!l.static) { |
| 195 | l = compactItemVertical(compareWith, l, sorted, maxY); |
| 196 | maxY = Math.max(maxY, l.y + l.h); |
| 197 | compareWith.push(l); |
| 198 | } |
| 199 | |
| 200 | const originalIndex = layout.indexOf(sortedItem); |
| 201 | out[originalIndex] = l; |
| 202 | l.moved = false; |
| 203 | } |
| 204 | |
| 205 | return out; |
| 206 | } |
| 207 | }; |
| 208 | |
| 209 | // ============================================================================ |
nothing calls this directly
no test coverage detected
searching dependent graphs…