Exporting as PNG accounts for device DPI. fixes cutoff PNGs

This commit is contained in:
Lance Ellis
2022-08-22 11:34:37 -05:00
committed by GitHub
parent 9e417d07f5
commit 1493abee84

View File

@@ -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;