fix: animationView position

This commit is contained in:
cha0s 2021-01-13 00:04:23 -06:00
parent 3153561f50
commit 3f10510208

View File

@ -113,7 +113,11 @@ export default (latus) => class Animated extends decorate(Trait) {
);
extended.animationViews = mapValues(
extended.animations,
(animation) => new AnimationView(animation),
(animation, key) => {
const animationView = new AnimationView(animation);
animationView.position = this.offsetFor(key);
return animationView;
},
);
}
return extended;
@ -187,7 +191,7 @@ export default (latus) => class Animated extends decorate(Trait) {
}
// Swap the animation.
this.hideAnimation(oldKey);
this.showAnimation(this.#currentAnimation);
this.showAnimation(currentAnimation);
},
directionChanged: () => {