Take device resolution into consideration when drawing image. Issue #2032
This commit is contained in:
parent
14e1dbe58e
commit
898681dfe6
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue