Skip to content

Commit

Permalink
Merge pull request #345 from VisActor/338-bug-container-resize-chart-…
Browse files Browse the repository at this point in the history
…display-exception

chart shake when after resize container #344
  • Loading branch information
fangsmile committed Sep 19, 2023
2 parents de874b5 + d1f4193 commit 1923a5d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"comment": "fix: chart shake when after resize container #344\n\n",
"type": "patch",
"packageName": "@visactor/vtable"
}
],
"packageName": "@visactor/vtable",
"email": "[email protected]"
}
2 changes: 1 addition & 1 deletion packages/vtable/src/scenegraph/layout/compute-col-width.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export function computeColsWidth(table: BaseTableAPI, colStart?: number, colEnd?
totalDrawWidth -
(update
? newWidths.reduce((acr, cur, index) => {
if (index >= table.rowHeaderLevelCount && index !== newWidths.length - 1) {
if (index >= table.rowHeaderLevelCount && index <= table.colCount - table.rightFrozenColCount - 2) {
return acr + cur;
}
return acr;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export function computeRowsHeight(
totalDrawHeight -
(update
? newHeights.reduce((acr, cur, index) => {
if (index >= table.frozenRowCount && index !== newHeights.length - 1) {
if (index >= table.frozenRowCount && index <= table.rowCount - table.bottomFrozenRowCount - 2) {
return acr + cur;
}
return acr;
Expand Down
1 change: 1 addition & 0 deletions packages/vtable/src/scenegraph/scenegraph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -851,6 +851,7 @@ export class Scenegraph {
}

updateRowHeight(row: number, detaY: number) {
detaY = Math.round(detaY);
updateRowHeight(this, row, detaY);
this.updateContainerHeight(row, detaY);
}
Expand Down

0 comments on commit 1923a5d

Please sign in to comment.