页面定时器与canvas组件使用同时使用, 绘制线条时特别卡顿
发布于 6 年前 作者 shaoyan 10938 次浏览 来自 官方Issues

场景是在 swipper  页面有使用定时器, 在使用 canvas 绘图功能时, 如下代码

then.data.draft.ctx.moveTo(then.data.draft.coord.x, then.data.draft.coord.y); // 设置路径起点坐标

then.data.draft.ctx.lineTo(rec.x, rec.y); // 绘制一条直线

then.data.draft.ctx.stroke();

then.data.draft.ctx.draw(true);

之前是正常流畅的, 不知道从何时起有使用定时器时, 定时器执行过程中, 再用绘制功能绘图变得非常卡顿, 测试了跟微信版本和基础库应该没什么关系

1 回复

麻烦提供出现问题的具体机型、微信版本号、系统版本号,以及能复现问题的代码片段https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html

回到顶部