From 1493abee848e144aa2e22e83082db4c3d19f7703 Mon Sep 17 00:00:00 2001 From: Lance Ellis <53070748+lanc33llis@users.noreply.github.com> Date: Mon, 22 Aug 2022 11:34:37 -0500 Subject: [PATCH] Exporting as PNG accounts for device DPI. fixes cutoff PNGs --- js/calendar.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/calendar.js b/js/calendar.js index 6aaccb56..8db33d5c 100644 --- a/js/calendar.js +++ b/js/calendar.js @@ -255,8 +255,8 @@ function buildICSFile(cal, event) { } function takePicture() { - var width = $("#calendar").width(); - var height = $("#calendar").height(); + var width = $("#calendar").width() * window.devicePixelRatio; + var height = $("#calendar").height() * window.devicePixelRatio; let cropper = document.createElement('canvas').getContext('2d'); html2canvas(document.querySelector("#calendar"), Export.png_options).then(c => { cropper.canvas.width = width;