canvas - Why context2d.backingStorePixelRatio deprecated? -
according paul lewis's article, high dpi canvas: need take business relationship context.backingstorepixelratio solve blurring issues.
if property deprecated, dart take care of blur issue on high definition device?
i thought exact same thing , far issue tracker tells:
yes, article written when safari had backing store ratio of 2. it's been 1 in chrome.
as approach dealing is:
canvas.width = width * window.devicepixelratio; canvas.height = height * window.devicepixelratio;
canvas.style.width = width + 'px'; canvas.style.height = height + 'px';
where width , height want them (probably window.innerwidth & innerheight total viewport shenanigans.)
then need adjust fact upscaled canvas with:
ctx.scale(window.devicepixelratio, window.devicepixelratio);
so there have solution.
canvas dart html5-canvas
No comments:
Post a Comment