Skip to content

Commit

Permalink
fix: fix progress cell create problem in vtable-export #1787
Browse files Browse the repository at this point in the history
  • Loading branch information
Rui-Sun committed May 24, 2024
1 parent e772cfb commit ee26f46
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@visactor/vtable",
"comment": "fix: fix progress cell create problem in vtable-export #1787",
"type": "none"
}
],
"packageName": "@visactor/vtable"
}
3 changes: 2 additions & 1 deletion packages/vtable-export/src/excel/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,14 +175,15 @@ function exportCellImg(col: number, row: number, tableInstance: IVTable) {
let needRemove = false;
if (cellGroup.role === 'empty') {
cellGroup = updateCell(col, row, tableInstance as any, true);
cellGroup.setStage(tableInstance.scenegraph.stage);
needRemove = true;
}
const oldStroke = cellGroup.attribute.stroke;
cellGroup.attribute.stroke = false;
const canvas = graphicUtil.drawGraphicToCanvas(cellGroup as any, tableInstance.scenegraph.stage) as HTMLCanvasElement;
cellGroup.attribute.stroke = oldStroke;
if (needRemove) {
cellGroup.parent.removeChild(cellGroup);
cellGroup.parent?.removeChild(cellGroup);
}
return canvas.toDataURL();
}
5 changes: 1 addition & 4 deletions packages/vtable/src/scenegraph/graphic/group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -377,10 +377,7 @@ export class Group extends VRenderGroup {
}

function after(group: Group, selfChange: boolean) {
if (!group.stage.dirtyBounds) {
return;
}
if (!(group.stage && group.stage.renderCount)) {
if (!group.stage || !group.stage.dirtyBounds || !group.stage.renderCount) {
return;
}
// group的子元素导致的bounds更新不用做dirtyBounds
Expand Down

0 comments on commit ee26f46

Please sign in to comment.