painterro
painterro copied to clipboard
getScale does not account for window.devicePixelRatio
Describe the bug
html2canvas defaults to window.devicePixelRatio
for the scale
property (docs), but getScale does not account for it. When scale
is passed to html2canvas, it overwrites the default value. This results in a blurry canvas for Retina / 2x displays.
Painterro version v1.2.57
Expected behavior I expect the arrows, text, lines, shapes, and other tools to not draw as blurry when using a Retina display.
Browser Chrome 91.0.4472.106 , Safari 14.1.1
Thanks a lot @jasonbarry . Just in case you need it urgently feel free to change that line of code and multiply by (window.devicePixelRatio || 1). Would be glad to accept PR.
Thanks for the quick response @ivictbor -- in my first tests, it looks like window.devicePixelRatio needs to be placed somewhere else so that it doesn't affect the rest of the coordinate system. I'll let you know if I find the right place to put it 👍
Since version 1.2.64 html@canvas has been changed to dom-to-image.