- 当前 Bug 的表现(可附上截图)打开摄像头,利用canvas绘制矩形,在开发者工具中可显示,真机调试不显示
- 预期表现 : 真机调试也可看见矩形框
- 复现路径
- 提供一个最简复现 Demo
<camera flash=“off” binderror=“error” style=“width: 100%; height: {{winHeight}}rpx;”>
<canvas canvas-id=“rectangle” style=“width: 100%; height: {{winHeight}}rpx;”></canvas>
</camera>
onReady: function () {
var that = this;
wx.getSystemInfo({
success: function (res) {
let winWidth = res.screenWidth;
console.log(res)
let scale = winWidth / 375;
let winHeight = ((res.screenHeight-120) * 2 / scale);
console.log(“winHeight:” + winHeight)
that.setData({
winHeight: winHeight,
})
var rec = wx.createCanvasContext(“rectangle”);
rec.setStrokeStyle(‘red’)
rec.strokeRect(res.screenWidth- 10, 10, 20, res.screenHeight - 140 )
rec.draw(true)
console.log(rec)
},
})
},
请提供一下出现问题的机型和微信版本,以及能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。