Take device pixel ratio into consideration when drawing the image to zoom. Issue #2032
This commit is contained in:
parent
704bffc7d2
commit
d5a4f1625a
|
@ -35,8 +35,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