Skip to content

Commit

Permalink
fix bug that the screenshot is broken when jsmind is zoomed (#553)
Browse files Browse the repository at this point in the history
  • Loading branch information
hizzgdev authored Dec 15, 2023
1 parent ca03b22 commit 9eb2e7d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/plugins/jsmind.screenshot.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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);
Expand Down

0 comments on commit 9eb2e7d

Please sign in to comment.