fixed bodies scaling

This commit is contained in:
2023-03-28 16:16:10 +02:00
parent 2d7f7e5499
commit 4727333dd6
2 changed files with 10 additions and 3 deletions

View File

@@ -201,6 +201,10 @@ export default {
this.scale = this.concernement.opened ? 5 : 1;
if (this.scale !== this.oldScale) {
// https://github.com/liabru/matter-js/issues/986#issuecomment-812488873
// revert to the original size (by reverting the previous scale)
Matter.Body.scale(this.body, 1 / this.oldScale, 1 / this.oldScale)
// then scale again
Matter.Body.scale(this.body, this.scale, this.scale)
}