fix: bounds
This commit is contained in:
parent
fa817e3072
commit
6997e108c0
|
@ -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};
|
||||
|
|
Loading…
Reference in New Issue
Block a user