we-plugin / we-cropper

微信小程序图片裁剪工具
https://we-plugin.github.io/we-cropper/#/
MIT License
2.17k stars 451 forks source link

[Bug Report] 【开发工具调试与真机调试BUG】 #138

Open YaroED opened 5 years ago

YaroED commented 5 years ago

we-cropper 版本

0.1.0

对应工具或者iOS或者Andriod的版本号

最新

微信版本号

最新

重现步骤

this.cropper = new WeCropper(cropperOpt)
  .on('ready', (ctx) => {
    console.log(`wecropper is ready for work!`)
  })
  .on('beforeDraw', (ctx) => {
    // 572为图片宽,920为高
    let qrCodeW = device.windowWidth * 220 / 572
    let qrCodeX = (device.windowWidth - qrCodeW) / 2, qrCodeY = device.windowHeight * 330 / 920

    // 在图片上加个二维码水印
    ctx.drawImage(rewardCode, qrCodeX, qrCodeY, qrCodeW, qrCodeW)
  })

期待的行为

海报上附带了生成的二维码

实际的行为

只有海报没有二维码。