- 当前 Bug 的表现(可附上截图)
iOS
Android
- 预期表现
如iOS
- 复现路径
- 提供一个最简复现 Demo
var context = wx.createCanvasContext( this .data.canvasId, this ); let width = 5.62; let height = 107; let x = 36.69; let y = 87.648; let radius = [2.81, 2.81, 0, 0]; context.setFillStyle( 'green' ) context.save(); // save the context so we don't mess up others context.beginPath(); // draw top and top right corner if (radius[0] === 0) { context.moveTo(x, y); } else { context.moveTo(x + radius[0], y); } if (radius[1] === 0) { context.lineTo(x + width, y, x + width); } else { context.arcTo(x + width, y, x + width, y + radius[1], radius[1]); } // draw right side and bottom right corner if (radius[2] === 0) { context.lineTo(x + width, y + height); } else { context.arcTo(x + width, y + height, x + width - radius[2], y + height, radius[2]); } // draw bottom and bottom left corner if (radius[3] === 0) { context.lineTo(x, y + height); } else { context.arcTo(x, y + height, x, y + height - radius[3], radius[3]); } // draw left and top left corner if (radius[0] === 0 ) { context.lineTo(x, y); } else { context.arcTo(x, y, x + radius[0], y, radius[0]); } context.fill(); context.stroke(); context.restore(); // restore context to what it was on entry context.draw() |
参考 https://developers.weixin.qq.com/community/develop/doc/0008aa80938e485f98a7e8e9456000
提供一下能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。
之前那个代码片段有乱码,重新生成了。
https://developers.weixin.qq.com/s/XtpwqWmc7g3C
反馈收到