Skip to content

Commit

Permalink
refactor(extension): 优化细节问题
Browse files Browse the repository at this point in the history
  • Loading branch information
fanyang committed Jul 15, 2024
1 parent d3a8dd5 commit c45574c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ export default function SnapshotExample() {
if (lfRef.current) {
setBase64Data('')
lfRef.current
.getSnapshotBlob('#FFFFFF', fileType)
.getSnapshotBlob('#fff', fileType)
.then(
({
data,
Expand Down
3 changes: 1 addition & 2 deletions packages/extension/src/tools/snapshot/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,8 @@ export class Snapshot {
// 画布当前渲染模式和用户导出渲染模式不一致时,需要更新画布
if (curPartial !== partial) {
this.lf.graphModel.setPartial(partial)
this.lf.graphModel.eventCenter.on('graph:updated', async () => {
this.lf.graphModel.eventCenter.once('graph:updated', async () => {
await this.getSnapshot(fileName, toImageOptions)
this.lf.graphModel.eventCenter.off('graph:updated')
// 恢复原来渲染模式
this.lf.graphModel.setPartial(curPartial)
})
Expand Down

0 comments on commit c45574c

Please sign in to comment.