// 图片渲染
export const imgRender = ({ img, width, height, X, Y, ctx }) => {
  if (!img) return Promise.resolve(null);

  return new Promise((resolve, reject) => {
    ctx.save();

    ctx.drawImage(img, X, Y, width, height);

    ctx.restore();

    resolve();
  });
};
