新版Canvas,跟随鼠标实时画图,多画一些会卡,有办法解决吗?
Canvas 2d touchmove(e){ this.setData({ x: e.touches[0].x, y: e.touches[0].y }); cav1.fields({node: true, size: true }) .exec((res)=>{ // Canvas 对象 canvas = res[0].node // Canvas 绘制上下文 ctx = canvas.getContext('2d') ctx.fillStyle = this.data.color; ctx.fillRect(this.data.x, this.data.y, this.data.size, this.data.size); }) },