MCPcopy Index your code
hub / github.com/jabbany/CommentCoreLibrary / animate

Method animate

src/core/Comment.ts:455–476  ·  view source on GitHub ↗

* Update the comment's position depending on the applied motion * groups.

()

Source from the content-addressed store, hash-verified

453 * groups.
454 */
455 public animate():void {
456 if (this._alphaMotion) {
457 this.alpha =
458 (this.dur - this.ttl) *
459 (this._alphaMotion['to'] - this._alphaMotion['from']) /
460 this.dur +
461 this._alphaMotion['from'];
462 }
463 if (this.motion.length === 0) {
464 return;
465 }
466 var ttl:number = Math.max(this.ttl, 0);
467 var time:number = (this.dur - ttl) - this._motionStart[this._curMotion];
468 this._execMotion(this.motion[this._curMotion], time);
469 if (this.dur - ttl > this._motionEnd[this._curMotion]) {
470 this._curMotion++;
471 if (this._curMotion >= this.motion.length) {
472 this._curMotion = this.motion.length - 1;
473 }
474 return;
475 }
476 }
477
478 /**
479 * Notify the comment to stop. This has no effect if the comment

Callers 2

initMethod · 0.95
updateMethod · 0.95

Calls 1

_execMotionMethod · 0.95

Tested by

no test coverage detected