diff --git a/src/components/ConcernementMapItem.vue b/src/components/ConcernementMapItem.vue index af5a272..7d16010 100644 --- a/src/components/ConcernementMapItem.vue +++ b/src/components/ConcernementMapItem.vue @@ -53,10 +53,11 @@ export default { tween: null, is_opening: false, is_closing: false, + is_hover: false, + // body: null, body_parts: [], constraint: null, - is_hover: false, // paper_main_object: {}, paper_groups: {} @@ -1067,6 +1068,8 @@ export default { if (this.is_hover) { this.paper_main_object.children['contours'].strokeColor = "#01ffe2"; this.paper_main_object.children['contours'].strokeWidth = 2; + + }else{ this.paper_main_object.children['contours'].strokeColor = "#fff"; this.paper_main_object.children['contours'].strokeWidth = 1; @@ -1720,7 +1723,12 @@ export default { onAfterEngineUpdate (event) { this.respawn(); - this.paper_main_object.position = this.pos = this.body.position; + if (this.is_hover) { // if mouse hover reset the matter body position to prev position + Matter.Body.setPosition(this.body, {x:this.pos.x, y:this.pos.y}, true); + } + + this.paper_main_object.position = this.pos = this.body.position; + this.handlePaperVisibilityOnAfterEnginUpdate() },