chore: duh

This commit is contained in:
cha0s 2021-04-07 00:58:29 -05:00
parent afd449da2f
commit 6e8e88f23e

View File

@ -139,10 +139,7 @@ export default (latus) => class Pictured extends decorate(Trait) {
traitAdded: () => {
Object.keys(this.#sprites).forEach((key) => {
const method = key === this.#currentImage
? 'showImage'
: 'hideImage';
this[method](key);
this[`${key === this.#currentImage ? 'show' : 'hide'}Image`](key);
});
this.setSpriteScale();
this.entity.forceBoundingBoxUpdate();
@ -192,10 +189,10 @@ export default (latus) => class Pictured extends decorate(Trait) {
if (!this.#sprites) {
return;
}
const rawScale = this.entity.visibleScale;
const {visibleScale} = this.entity;
const sprites = Object.values(this.#sprites);
for (let i = 0; i < sprites.length; i++) {
sprites[i].scale = rawScale;
sprites[i].scale = visibleScale;
}
}