Take device resolution into consideration when drawing image. Issue #2032

This commit is contained in:
Maurice Parker 2020-04-30 15:34:17 -05:00
parent 14e1dbe58e
commit 898681dfe6
1 changed files with 2 additions and 2 deletions

View File

@ -34,8 +34,8 @@ class ImageViewer {
this.hideLoadingIndicator();
var canvas = document.createElement("canvas");
canvas.width = this.img.naturalWidth;
canvas.height = this.img.naturalHeight;
canvas.width = this.img.naturalWidth * window.devicePixelRatio;
canvas.height = this.img.naturalHeight * window.devicePixelRatio;
canvas.getContext("2d").drawImage(this.img, 0, 0, canvas.width, canvas.height);
const rect = this.img.getBoundingClientRect();