diff --git a/src/app/football-field/football-field.component.ts b/src/app/football-field/football-field.component.ts index 6561030..3384e1a 100644 --- a/src/app/football-field/football-field.component.ts +++ b/src/app/football-field/football-field.component.ts @@ -360,8 +360,8 @@ export class FootballFieldComponent { //console.log("[updateTimeIndicator] Timeline:",timeline.getBoundingClientRect().left, "px -", timeline.getBoundingClientRect().right, "px"); if(timeIndicator) { let timePosition = timeline.offsetLeft + (currentTime / this.getTotalTimelineDuration()) * this.timelineWidth; - if(timePosition >= this.timelineWidth) { - timePosition = timeline.getBoundingClientRect().left; + if(timePosition >= (timeline.offsetLeft + this.timelineWidth)) { + timePosition = timeline.offsetLeft; this.isPlaying = false; } this.linePosition = timePosition; @@ -440,11 +440,13 @@ export class FootballFieldComponent { player.design.x = (1 - t) * step.startX + t * step.endX; player.design.y = (1 - t) * step.startY + t * step.endY; + /* // Si le joueur a le ballon "aimanté", on met à jour la position // du ballon en même temps que celui du ballon if (player.hasBall) { this.updateBallPositionOnPlayer(player); } + */ } } @@ -1355,6 +1357,10 @@ export class FootballFieldComponent { console.log("[onLineMouseMove] clientX:",event.clientX,"- initialMouseX:",this.initialMouseX,"- offsetLeft:",timeline.offsetLeft); this.linePosition += deltaX; // Déplacer la ligne this.initialMouseX = event.clientX; // Réinitialiser la position de départ + this.players.forEach(player => { + this.updatePlayerPosition(player); + }); + } // Terminer le déplacement de la ligne