Exporting as PNG accounts for device DPI. fixes cutoff PNGs
This commit is contained in:
@@ -255,8 +255,8 @@ function buildICSFile(cal, event) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function takePicture() {
|
function takePicture() {
|
||||||
var width = $("#calendar").width();
|
var width = $("#calendar").width() * window.devicePixelRatio;
|
||||||
var height = $("#calendar").height();
|
var height = $("#calendar").height() * window.devicePixelRatio;
|
||||||
let cropper = document.createElement('canvas').getContext('2d');
|
let cropper = document.createElement('canvas').getContext('2d');
|
||||||
html2canvas(document.querySelector("#calendar"), Export.png_options).then(c => {
|
html2canvas(document.querySelector("#calendar"), Export.png_options).then(c => {
|
||||||
cropper.canvas.width = width;
|
cropper.canvas.width = width;
|
||||||
|
|||||||
Reference in New Issue
Block a user