From f39f66ae456eb2cd9f13d97d0dcec3380463ef2b Mon Sep 17 00:00:00 2001 From: lijinke666 Date: Fri, 8 Nov 2024 15:22:07 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/s2-core/src/facet/pivot-facet.ts | 6 +++--- packages/s2-core/src/facet/table-facet.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/s2-core/src/facet/pivot-facet.ts b/packages/s2-core/src/facet/pivot-facet.ts index f9d169dc68..3630628bd5 100644 --- a/packages/s2-core/src/facet/pivot-facet.ts +++ b/packages/s2-core/src/facet/pivot-facet.ts @@ -205,10 +205,10 @@ export class PivotFacet extends FrozenFacet { this.calculateColLeafNodesWidth(layoutResult); // 2. 根据叶子节点宽度计算所有父级节点宽度和 x 坐标, 便于计算自动换行后节点的真实高度 this.calculateColNodeWidthAndX(colLeafNodes); - // 3. 计算每一层级的采样节点 - this.updateColsHierarchySampleMaxHeightNodes(colsHierarchy); - // 4. 计算所有节点的高度 + // 3. 计算所有节点的高度 this.calculateColNodesHeight(colsHierarchy); + // 4. 计算每一层级的采样节点 + this.updateColsHierarchySampleMaxHeightNodes(colsHierarchy); // 5. 如果存在自定义多级列头, 还需要更新某一层级的采样 this.updateCustomFieldsSampleNodes(colsHierarchy); // 6. 补齐自定义列头节点缺失的高度 diff --git a/packages/s2-core/src/facet/table-facet.ts b/packages/s2-core/src/facet/table-facet.ts index 4fb47a3c61..290d747dc0 100644 --- a/packages/s2-core/src/facet/table-facet.ts +++ b/packages/s2-core/src/facet/table-facet.ts @@ -489,8 +489,8 @@ export class TableFacet extends FrozenFacet { // 先计算宽度, 再计算高度, 确保计算多行文本时能获取到正确的最大文本宽度 this.calculateColLeafNodesWidth(colLeafNodes, colsHierarchy); this.calculateColNodeWidthAndX(colLeafNodes); - this.updateColsHierarchySampleMaxHeightNodes(colsHierarchy); this.calculateColNodesHeight(colsHierarchy); + this.updateColsHierarchySampleMaxHeightNodes(colsHierarchy); this.updateCustomFieldsSampleNodes(colsHierarchy); this.adjustCustomColLeafNodesHeight({ leafNodes: colLeafNodes,