I was having issues using the signature pad on a modal popup, so I tried taking your latest github code.
What I found is that when the screen is resized (say by rotating a mobile from portrait to landscape) the canvas size is doubling each time, because in the onResize() method below the "ratio" is 2.
Is this something you're aware of / looking at?
I've fixed it on a local version by doing this, but there may be a better way:
scope.onResize = function () {
var canvas = element.find('canvas')[0];
// Make it visually fill the positioned parent
canvas.style.width = '100%';
canvas.style.height = '100%';
// ...then set the internal size to match
canvas.width = canvas.offsetWidth;
canvas.height = canvas.offsetHeight;
// reset dataurl
scope.dataurl = null;
};
Hi,
I was having issues using the signature pad on a modal popup, so I tried taking your latest github code. What I found is that when the screen is resized (say by rotating a mobile from portrait to landscape) the canvas size is doubling each time, because in the onResize() method below the "ratio" is 2.
Is this something you're aware of / looking at?
I've fixed it on a local version by doing this, but there may be a better way: