From 9eb2e7d553452c9c84261c2da1e57c5e9e96e054 Mon Sep 17 00:00:00 2001 From: Zhigang Zhang Date: Fri, 15 Dec 2023 22:50:09 +0800 Subject: [PATCH] fix bug that the screenshot is broken when jsmind is zoomed (#553) --- src/plugins/jsmind.screenshot.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/jsmind.screenshot.js b/src/plugins/jsmind.screenshot.js index 6d796b33..fa344a59 100644 --- a/src/plugins/jsmind.screenshot.js +++ b/src/plugins/jsmind.screenshot.js @@ -53,6 +53,7 @@ class JmScreenshot { let c = $.c('canvas'); c.width = this.jm.view.size.w; c.height = this.jm.view.size.h; + c.style.visibility = 'hidden'; this.jm.view.e_panel.appendChild(c); return c; } @@ -73,7 +74,7 @@ class JmScreenshot { draw_nodes(ctx) { return domtoimage - .toSvg(this.jm.view.e_nodes) + .toSvg(this.jm.view.e_nodes, { style: { zoom: 1 } }) .then(this.load_image) .then(function (img) { ctx.drawImage(img, 0, 0);