Fix blurry links on HiDPI screen (#116)

This commit is contained in:
Cesaryuan
2024-09-05 23:09:29 +08:00
committed by GitHub
parent 79d81ec990
commit 49944a0745

View File

@@ -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
@@ -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;