Skip to content

Commit cc2a253

Browse files
authored
Merge pull request #3711 from VisActor/refactor/computeColsWidth_api_call_time
refactor: computeColsWidth api call time
2 parents f179464 + 5d3f0d7 commit cc2a253

3 files changed

Lines changed: 23 additions & 4 deletions

File tree

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"changes": [
3+
{
4+
"comment": "fix: repeat call computeColsWidth adaptive mode result error\n\n",
5+
"type": "none",
6+
"packageName": "@visactor/vtable"
7+
}
8+
],
9+
"packageName": "@visactor/vtable",
10+
"email": "892739385@qq.com"
11+
}

packages/vtable/src/scenegraph/group-creater/progress/create-group-for-first-screen.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,15 @@ export function createGroupForFirstScreen(
6666

6767
if (distCol < table.colCount - table.rightFrozenColCount) {
6868
// compute right frozen row height
69-
computeColsWidth(table, table.colCount - table.rightFrozenColCount, table.colCount - 1);
69+
if (table.colCount - table.rightFrozenColCount <= table.colCount - 1) {
70+
computeColsWidth(table, table.colCount - table.rightFrozenColCount, table.colCount - 1);
71+
}
7072
}
7173
if (distRow < table.rowCount - table.bottomFrozenRowCount) {
7274
// compute bottom frozen row height
73-
computeRowsHeight(table, table.rowCount - table.bottomFrozenRowCount, table.rowCount - 1);
75+
if (table.rowCount - table.bottomFrozenRowCount <= table.rowCount - 1) {
76+
computeRowsHeight(table, table.rowCount - table.bottomFrozenRowCount, table.rowCount - 1);
77+
}
7478
}
7579

7680
// update colHeaderGroup rowHeaderGroup bodyGroup position

packages/vtable/src/scenegraph/group-creater/progress/proxy.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,9 @@ export class SceneProxy {
392392
createColGroup(onceCount: number) {
393393
// compute rows height
394394
const endCol = Math.min(this.totalCol, this.currentCol + onceCount);
395-
computeColsWidth(this.table, this.currentCol + 1, endCol);
395+
if (this.table.widthMode !== 'adaptive') {
396+
computeColsWidth(this.table, this.currentCol + 1, endCol);
397+
}
396398

397399
this.colEnd = endCol;
398400

@@ -693,7 +695,9 @@ export class SceneProxy {
693695
// colGroup.needUpdate = false;
694696
// }
695697
// }
696-
computeColsWidth(this.table, this.colUpdatePos, distCol);
698+
if (this.table.widthMode === 'autoWidth') {
699+
computeColsWidth(this.table, this.colUpdatePos, distCol);
700+
}
697701
updateColContent(this.colUpdatePos, distCol, this);
698702
this.colUpdatePos = distCol + 1;
699703
}

0 commit comments

Comments
 (0)