From 898681dfe6478467562ba342429f38b0dc43ba91 Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Thu, 30 Apr 2020 15:34:17 -0500 Subject: [PATCH] Take device resolution into consideration when drawing image. Issue #2032 --- iOS/Resources/main_ios.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iOS/Resources/main_ios.js b/iOS/Resources/main_ios.js index 84508f002..5c7ca4f74 100644 --- a/iOS/Resources/main_ios.js +++ b/iOS/Resources/main_ios.js @@ -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();