mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2025-02-09 00:28:53 +01:00
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();
|
this.hideLoadingIndicator();
|
||||||
|
|
||||||
var canvas = document.createElement("canvas");
|
var canvas = document.createElement("canvas");
|
||||||
canvas.width = this.img.naturalWidth;
|
canvas.width = this.img.naturalWidth * window.devicePixelRatio;
|
||||||
canvas.height = this.img.naturalHeight;
|
canvas.height = this.img.naturalHeight * window.devicePixelRatio;
|
||||||
canvas.getContext("2d").drawImage(this.img, 0, 0, canvas.width, canvas.height);
|
canvas.getContext("2d").drawImage(this.img, 0, 0, canvas.width, canvas.height);
|
||||||
|
|
||||||
const rect = this.img.getBoundingClientRect();
|
const rect = this.img.getBoundingClientRect();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user