/**
 * 修复Canvase模糊的问题
 * @param {*} canvas
 * @param {*} context
 * @param {number} width  // canvas实际宽度
 * @param {number} height // canvas实际高度
 */
function canvasVoidBlur(canvas, context, width, height) {
  var devicePixelRatio = window.devicePixelRatio || 1;
  var backingStoreRatio = canvas.webkitBackingStorePixelRatio || 1;
  var ratio = devicePixelRatio / backingStoreRatio;
  canvas.width = width * ratio;
  canvas.height = height * ratio;
  canvas.style.width = "".concat(width, "px");
  canvas.style.height = "".concat(height, "px");
  context.scale(ratio, ratio);
}

export default canvasVoidBlur;
