在canvas上使用clip()画圆形头像,但是在真机上无法显示出来
- 当前 Bug 的表现(可附上截图)
用canvas画圆形头像使用clip()剪切,在真机上不显示
- 预期表现
出现图片 编辑器上的显示
-
复现路径
-
提供一个最简复现 Demo
const ctx = wx.createCanvasContext(“canvasId”);
ctx.arc(headImgWidth / 2 + 30, headImgHeight / 2 + 53, headImgWidth / 2, Math.PI * 2, false);
ctx.clip();
ctx.drawImage(‘/img/gem.jpg’, 30, 53, headImgWidth, headImgHeight);
ctx.restore();
ctx.draw();
