From 980ae6e5a1ac611fd92d155fc7dd7f17e7bf3da7 Mon Sep 17 00:00:00 2001 From: bach Date: Mon, 2 Oct 2023 16:00:07 +0200 Subject: [PATCH] mapitems matter body is not scaling anymore --- src/components/ConcernementMapItem.vue | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/components/ConcernementMapItem.vue b/src/components/ConcernementMapItem.vue index 0689f37..f50654e 100644 --- a/src/components/ConcernementMapItem.vue +++ b/src/components/ConcernementMapItem.vue @@ -1573,10 +1573,10 @@ export default { .onUpdate((obj) => { // 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.scale, 1 / this.scale) + // Matter.Body.scale(this.body, 1 / this.scale, 1 / this.scale) this.paper_main_object.scale(1 / this.scale); // then scale again to new scale - Matter.Body.scale(this.body, obj.s, obj.s) + // Matter.Body.scale(this.body, obj.s, obj.s) this.paper_main_object.scale(obj.s); // update superposition constraints points poisitions @@ -1667,10 +1667,12 @@ export default { .onUpdate((obj) => { // 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.scale, 1 / this.scale) + // INFO we dont need to sacle the matter body AND it may fix the montgolfière bug + // TODO find another way to increase the mass + // Matter.Body.scale(this.body, 1 / this.scale, 1 / this.scale) this.paper_main_object.scale(1 / this.scale); // then scale again to new scale - Matter.Body.scale(this.body, obj.s, obj.s) + // Matter.Body.scale(this.body, obj.s, obj.s) this.paper_main_object.scale(obj.s); // update superposition constraints points positions