提交 98023983 编写于 作者: H hdx

chord(canvas): 避免使用 bind this

上级 28442497
...@@ -62,9 +62,6 @@ ...@@ -62,9 +62,6 @@
this.ctx = ctx this.ctx = ctx
this.initBall() this.initBall()
this.ctx.fillStyle = '#007AFF' this.ctx.fillStyle = '#007AFF'
// #ifdef WEB
this._bindAnimate = this.animate.bind(this)
// #endif
} }
private getDistance(x : number, y : number) : number { private getDistance(x : number, y : number) : number {
...@@ -106,7 +103,9 @@ ...@@ -106,7 +103,9 @@
if (!this.runningFlag) { if (!this.runningFlag) {
return return
} }
this._animateResult = requestAnimationFrame(this.animate.bind(this)) this._animateResult = requestAnimationFrame(() => {
this.animate()
})
// #endif // #endif
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册