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; super.frame = this.frames ? frame % this.frames : 0;
} }
get frames() { get frames() {
return this.animation if (
? ( !this.animation
this.$$sourceJson.animations || !this.$$sourceJson.animations
? this.$$sourceJson.animations[this.animation].length || !(this.animation in this.$$sourceJson.animations)
: 0 ) {
) return 0;
: 0; }
return this.$$sourceJson.animations[this.animation].length;
} }
get scale() { get scale() {
return {x: this.scaleX, y: this.scaleY}; return {x: this.scaleX, y: this.scaleY};