Skip to content

Commit

Permalink
fix: 优化计算逻辑
Browse files Browse the repository at this point in the history
  • Loading branch information
lijinke666 committed Nov 8, 2024
1 parent ee307e3 commit f39f66a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions packages/s2-core/src/facet/pivot-facet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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. 补齐自定义列头节点缺失的高度
Expand Down
2 changes: 1 addition & 1 deletion packages/s2-core/src/facet/table-facet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit f39f66a

Please sign in to comment.