Skip to content

Commit c45574c

Browse files
author
fanyang
committed
refactor(extension): 优化细节问题
1 parent d3a8dd5 commit c45574c

File tree

2 files changed

+2
-3
lines changed
  • examples/feature-examples/src/pages/extensions/snapshot
  • packages/extension/src/tools/snapshot

2 files changed

+2
-3
lines changed

examples/feature-examples/src/pages/extensions/snapshot/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ export default function SnapshotExample() {
149149
if (lfRef.current) {
150150
setBase64Data('')
151151
lfRef.current
152-
.getSnapshotBlob('#FFFFFF', fileType)
152+
.getSnapshotBlob('#fff', fileType)
153153
.then(
154154
({
155155
data,

packages/extension/src/tools/snapshot/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,8 @@ export class Snapshot {
4747
// 画布当前渲染模式和用户导出渲染模式不一致时,需要更新画布
4848
if (curPartial !== partial) {
4949
this.lf.graphModel.setPartial(partial)
50-
this.lf.graphModel.eventCenter.on('graph:updated', async () => {
50+
this.lf.graphModel.eventCenter.once('graph:updated', async () => {
5151
await this.getSnapshot(fileName, toImageOptions)
52-
this.lf.graphModel.eventCenter.off('graph:updated')
5352
// 恢复原来渲染模式
5453
this.lf.graphModel.setPartial(curPartial)
5554
})

0 commit comments

Comments
 (0)