This commit is contained in:
2024-10-17 22:12:12 +00:00
parent 79af91fad6
commit a6cd5a93b7

View File

@@ -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