fix: bounds

This commit is contained in:
cha0s 2024-07-22 01:25:05 -05:00
parent fa817e3072
commit 6997e108c0

View File

@ -22,13 +22,14 @@ export default class Sprite extends Component {
super.frame = this.frames ? frame % this.frames : 0;
}
get frames() {
return this.animation
? (
this.$$sourceJson.animations
? this.$$sourceJson.animations[this.animation].length
: 0
)
: 0;
if (
!this.animation
|| !this.$$sourceJson.animations
|| !(this.animation in this.$$sourceJson.animations)
) {
return 0;
}
return this.$$sourceJson.animations[this.animation].length;
}
get scale() {
return {x: this.scaleX, y: this.scaleY};