最新版ios版本微信6.6.7 小程序canvas不支持clip方法
发布于 5 年前 作者 xiuyingdu 16984 次浏览 来自 问答

最新版ios版本微信6.6.7 小程序canvas不支持clip方法,

比如需要吧图片绘制到指定矩形区域或圆形,如下代码无效果。

ctx.save();

ctx.beginPath();

if (border) {

    // ctx.beginPath();

    ctx.arc(

    centerX,

    centerY,

    _self.px2rem(radius),

    0, 2 * Math.PI);

}else{

    ctx.rect(left, top, width, height);

}

ctx.clip();

ctx.drawImage(

    img.path,

    left,

    top,

    parseInt(width),

    parseInt(dstHeight));

ctx.restore();

5 回复

修复了吗…(2019-11-20 留)

微信7.0.4还是坏的 现在修好了吗

你好,是更新了客户端版本到6.6.7之后该方法不执行了是吗?之前更新前是正常的吗?方便给个能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html?search-key=%E4%BB%A3%E7%A0%81%E7%89%87%E6%AE%B5)吗

安卓版本 6.6.7 也是 坏的,现在修好了吗

6.6.2没用,现在更新到6.6.7clip方法也没用

回到顶部