From 7a9101a4eeab3dfd64bcd35ff18129d3719cb854 Mon Sep 17 00:00:00 2001 From: Igor Zinken Date: Fri, 21 Jan 2022 07:36:30 +0100 Subject: [PATCH] Only generate snapshot once in image export window --- src/components/file-menu/export-image/export-image.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/file-menu/export-image/export-image.vue b/src/components/file-menu/export-image/export-image.vue index 6e8b1e4..57557e2 100644 --- a/src/components/file-menu/export-image/export-image.vue +++ b/src/components/file-menu/export-image/export-image.vue @@ -207,6 +207,7 @@ export default { beforeDestroy() { this.base64preview = null; this.snapshots = null; + this.snapshot = null; }, methods: { ...mapMutations([ @@ -250,7 +251,10 @@ export default { } snapshotCvs = tilesToSingle( this.snapshots, width, height, parseFloat( this.sheetCols || "4" )); } else { - snapshotCvs = await createDocumentSnapshot( this.activeDocument ); + if ( !this.snapshot ) { + this.snapshot = await createDocumentSnapshot( this.activeDocument ); + } + snapshotCvs = this.snapshot; } this.width = snapshotCvs.width; this.height = snapshotCvs.height;