//=== canvas 模糊问题 start
var ratio = getPixelRatio(ct);
if(ratio == 1) { // PC端 PixelRatio
ratio = 2;
}
cs.style.width = cs.width + 'px';
cs.style.height = cs.height + 'px';
cs.width = cs.width * ratio;
cs.height = cs.height * ratio;
ct.scale(ratio, ratio);
//=== canvas 模糊问题 end
var getPixelRatio = function (context) {
var backingStore = context.backingStorePixelRatio ||
context.webkitBackingStorePixelRatio ||
context.mozBackingStorePixelRatio ||
context.msBackingStorePixelRatio ||
context.oBackingStorePixelRatio ||
context.backingStorePixelRatio || 1;
return (window.devicePixelRatio || 1) / backingStore;
};
打开App,阅读手记