Pārlūkot izejas kodu

mapitems matter body is not scaling anymore

bach 1 gadu atpakaļ
vecāks
revīzija
980ae6e5a1
1 mainītis faili ar 6 papildinājumiem un 4 dzēšanām
  1. 6 4
      src/components/ConcernementMapItem.vue

+ 6 - 4
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