Skip to content

Commit

Permalink
fix: fix reference computation in proxy module
Browse files Browse the repository at this point in the history
  • Loading branch information
Rui-Sun committed Jul 7, 2023
1 parent 1e1c88c commit f587d63
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions packages/vtable/src/scenegraph/group-creater/progress/proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,22 +197,22 @@ export class SceneProxy {
this.currentRow = this.totalRow;
this.rowEnd = this.currentRow;
this.rowUpdatePos = this.rowEnd;
this.referenceRow = Math.floor((this.rowEnd - this.rowStart) / 2);
this.referenceRow = this.rowStart + Math.floor((this.rowEnd - this.rowStart) / 2);

this.currentCol = this.totalCol;
this.colEnd = this.currentCol;
this.colUpdatePos = this.colEnd;
this.referenceCol = Math.floor((this.colEnd - this.colStart) / 2);
this.referenceCol = this.colStart + Math.floor((this.colEnd - this.colStart) / 2);
} else {
this.currentRow = (bodyGroup.firstChild as Group)?.rowNumber ?? this.totalRow;
this.rowEnd = this.currentRow;
this.rowUpdatePos = this.rowEnd;
this.referenceRow = Math.floor((this.rowEnd - this.rowStart) / 2);
this.referenceRow = this.rowStart + Math.floor((this.rowEnd - this.rowStart) / 2);

this.currentCol = (bodyGroup.lastChild as Group)?.col ?? this.totalCol;
this.colEnd = this.currentCol;
this.colUpdatePos = this.colEnd;
this.referenceCol = Math.floor((this.colEnd - this.colStart) / 2);
this.referenceCol = this.colStart + Math.floor((this.colEnd - this.colStart) / 2);

// 开始异步任务
await this.progress();
Expand Down Expand Up @@ -359,7 +359,7 @@ export class SceneProxy {
this.currentRow = endRow;
this.rowEnd = endRow;
this.rowUpdatePos = this.rowEnd;
this.referenceRow = Math.floor((endRow - this.rowStart) / 2);
this.referenceRow = this.rowStart + Math.floor((endRow - this.rowStart) / 2);

// update container group size and border
this.table.scenegraph.updateContainer();
Expand Down Expand Up @@ -395,7 +395,7 @@ export class SceneProxy {
this.currentCol = endCol;
this.colEnd = endCol;
this.colUpdatePos = this.colEnd;
this.referenceCol = Math.floor((endCol - this.colStart) / 2);
this.referenceCol = this.colStart + Math.floor((endCol - this.colStart) / 2);
console.log('async', this.referenceCol, this.colStart, this.colEnd);

// update container group size and border
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ async function moveCell(count: number, direction: 'up' | 'down', screenTopRow: n
(proxy.table as any).scenegraph.bodyGroup.firstChild.lastChild.row
);

proxy.table.scenegraph.stage.render();
// proxy.table.scenegraph.stage.render();
await proxy.progress();
} else {
const distStartRow = direction === 'up' ? proxy.rowStart + count : proxy.rowStart - count;
Expand Down

0 comments on commit f587d63

Please sign in to comment.