Skip to content

Commit

Permalink
Fix blurry links on HiDPI screen (#116)
Browse files Browse the repository at this point in the history
  • Loading branch information
cesaryuan authored Sep 5, 2024
1 parent 79d81ec commit 49944a0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/litegraph.js
Original file line number Diff line number Diff line change
Expand Up @@ -8739,7 +8739,8 @@ const globalExport = {};
if (this.bgcanvas == this.canvas) {
this.drawBackCanvas();
} else {
ctx.drawImage(this.bgcanvas, 0, 0);
let scale = window.devicePixelRatio;
ctx.drawImage(this.bgcanvas, 0, 0, this.bgcanvas.width / scale, this.bgcanvas.height / scale);
}

//rendering
Expand Down Expand Up @@ -9245,8 +9246,9 @@ const globalExport = {};

//reset in case of error
if (!this.viewport) {
let scale = window.devicePixelRatio;
ctx.restore();
ctx.setTransform(1, 0, 0, 1, 0, 0);
ctx.setTransform(scale, 0, 0, scale, 0, 0);
}
this.visible_links.length = 0;

Expand Down

0 comments on commit 49944a0

Please sign in to comment.