diff --git a/resources/views/account/accept/create.blade.php b/resources/views/account/accept/create.blade.php index b9843cd47b..8b25d51d3d 100644 --- a/resources/views/account/accept/create.blade.php +++ b/resources/views/account/accept/create.blade.php @@ -111,21 +111,20 @@ signaturePad; // Adjust canvas coordinate space taking into account pixel ratio, - // to make it look crisp on mobile devices. - // This also causes canvas to be cleared. - if (window.matchMedia("(min-width: 768px)").matches) { - function resizeCanvas() { - // When zoomed out to less than 100%, for some very strange reason, - // some browsers report devicePixelRatio as less than 1 - // and only part of the canvas is cleared then. - var ratio = Math.max(window.devicePixelRatio || 1, 1); - canvas.width = canvas.offsetWidth * ratio; - canvas.height = canvas.offsetHeight * ratio; - canvas.getContext("2d").scale(ratio, ratio); - } - window.onresize = resizeCanvas; - resizeCanvas(); + // to make it look crisp on smaller screens. + // https://github.com/szimek/signature_pad#handling-high-dpi-screens + // (This also causes canvas to be cleared.) + function resizeCanvas() { + // When zoomed out to less than 100%, for some very strange reason, + // some browsers report devicePixelRatio as less than 1 + // and only part of the canvas is cleared then. + var ratio = Math.max(window.devicePixelRatio || 1, 1); + canvas.width = canvas.offsetWidth * ratio; + canvas.height = canvas.offsetHeight * ratio; + canvas.getContext("2d").scale(ratio, ratio); } + window.onresize = resizeCanvas; + resizeCanvas(); signaturePad = new SignaturePad(canvas); @@ -144,4 +143,4 @@ -@stop \ No newline at end of file +@stop