cancel if no cursors to animate.

This commit is contained in:
Miroslav Šedivý 2021-11-11 23:54:11 +01:00
parent 6afa3c68de
commit 5b34f906c6

View File

@ -127,9 +127,17 @@
this._points.push(pos) this._points.push(pos)
} }
const startAnimation = this._percent > 1 || this._percent == 0 // no cursors to animate
if (this._points.length == 0) {
return
}
// start animation if not running
const percent = this._percent
this._percent = 0 this._percent = 0
if (startAnimation) this.canvasAnimate() if (percent > 1 || percent == 0) {
this.canvasAnimate()
}
} }
canvasRedraw(x: number, y: number, id: string) { canvasRedraw(x: number, y: number, id: string) {