updateAngle()

in client/src/components/translation-selector/selection-line.ts [43:59]


  updateAngle() {
    let complete = false;
    let angle;
    const da = this.targetAngle - this.currentAngle;
    const maxDa = this.config.rotateSpeed / this.config.animationInterval;
    if (Math.abs(da) > maxDa) {
      angle = this.currentAngle + Math.sign(da) * maxDa;
    } else {
      complete = true;
      angle = this.targetAngle;
    }
    this.setAngle(angle);
    if (complete && this.animationTimer) {
      clearInterval(this.animationTimer);
      this.animationTimer = null;
    }
  }