- 注册时间
- 2014-9-28
- 最后登录
- 2022-10-14
- 阅读权限
- 30
- 积分
- 211
- 精华
- 0
- 帖子
- 29

|
发表于 2021-8-13 11:30:32
|显示全部楼层
shape.graphics.add(function (ctx) {
ctx.beginPath();
ctx.moveTo(x0, y0);
ctx.quadraticCurveTo(x1, y1, x2, y2);
ctx.stroke();
})
我是用add绘制了一个贝塞尔曲线,其中(x0,y0)是起点,(x1,y1)是控制点,(x2,y2)是终点,发现在改变变量值后,曲线会实时改变,但是并没有写重新绘制的逻辑,于是我猜测,是不是add在实时绘制呢?还是说只是在变量改变的时候绘制呢,这是怎么一个原理呢? |
|