[ts][player] Fix state.setAnimation and player.setViewport not working on success callback.

This commit is contained in:
Davide Tantillo 2025-02-13 11:52:01 +01:00
parent 44646bedfa
commit 6792bc72c1

View File

@ -561,8 +561,13 @@ export class SpinePlayer implements Disposable {
this.setViewport(entry.animation!);
this.pause();
}
} else if (!this.currentViewport) {
this.setViewport(entry.animation!);
} else {
if (this.currentViewport.x === undefined) {
this.setViewport(entry.animation!);
}
if (!config.animation) {
config.animation = entry.animation?.name
}
this.play();
}
}