(node: GridNode<T>, x: number, y: number)
| 458 | } |
| 459 | |
| 460 | protected buildRow(node: GridNode<T>, x: number, y: number): LayoutNode { |
| 461 | let collection = this.virtualizer!.collection as TableCollection<T>; |
| 462 | let rect = new Rect(x, y, 0, 0); |
| 463 | let layoutInfo = new LayoutInfo('row', node.key, rect); |
| 464 | |
| 465 | let children: LayoutNode[] = []; |
| 466 | let height = 0; |
| 467 | for (let child of getChildNodes(node, collection)) { |
| 468 | if (child.type === 'cell') { |
| 469 | if (x > this.requestedRect.maxX) { |
| 470 | // Adjust existing cached layoutInfo to ensure that it is out of view. |
| 471 | // This can happen due to column resizing. |
| 472 | let layoutNode = this.layoutNodes.get(child.key); |
| 473 | if (layoutNode) { |
| 474 | layoutNode.layoutInfo.rect.x = x; |
| 475 | x += layoutNode.layoutInfo.rect.width; |
| 476 | } else { |
| 477 | break; |
| 478 | } |
| 479 | } else { |
| 480 | let layoutNode = this.buildChild(child, x, y, layoutInfo.key); |
| 481 | x = layoutNode.layoutInfo.rect.maxX; |
| 482 | height = Math.max(height, layoutNode.layoutInfo.rect.height); |
| 483 | layoutNode.index = children.length; |
| 484 | children.push(layoutNode); |
| 485 | } |
| 486 | } |
| 487 | } |
| 488 | |
| 489 | this.setChildHeights(children, height); |
| 490 | |
| 491 | rect.width = this.layoutNodes.get(collection.head?.key ?? 'header')!.layoutInfo.rect.width; |
| 492 | rect.height = height; |
| 493 | |
| 494 | return { |
| 495 | layoutInfo, |
| 496 | children, |
| 497 | validRect: rect.intersection(this.requestedRect), |
| 498 | node |
| 499 | }; |
| 500 | } |
| 501 | |
| 502 | protected buildCell(node: GridNode<T>, x: number, y: number): LayoutNode { |
| 503 | let width = this.getRenderedColumnWidth(node); |
no test coverage detected