描述问题请描述清楚
@ray-js/pencil-flow的使用
Re: @ray-js/pencil-flow的使用
问题1: 添加代码
Code: Select all
const line = new Line(element);
this.stage.add(line);
会导致触摸事件异常,异常情况就是我说的定位到问题那条评论;
问题2:
Code: Select all
// 重新渲染画布
this.stage.ctx.clearRect(0, 0, this.canvasWidth, this.canvasHeight);
this.renderStrip(this.stage, this.ctx, data);
this.stage.update();
没有更新到最新的颜色,还是生成画布的颜色
Re: @ray-js/pencil-flow的使用
已经解决问题了
干扰触摸事件是因为
Code: Select all
const line = new Line(element);
this.stage.add(line);
会默认响应事件需要设置 line.ignoreHit = true; 忽略任何事件
update不更新color是因为addIdxShapeIns方法判断this[idx]存在直接return了没有更新data数据
另外希望官方可以补充一下文档,本来是想提高效率的,找半天找不到文档,只能在npm英文文档的库示例,bug找半天还需要看源码才能定位到问题,因为可能后续还需要用到这些库,其他开发者用到也会方便很多
Re: @ray-js/pencil-flow的使用
感谢建议,是有对外文档的,一般在物料广场 ( https://developer.tuya.com/material/lib ... PencilFlow ),关于多层级事件问题会在文档中进行补充说明