From 2a90e7c7870fb55ee922a7a515c92d699f676a40 Mon Sep 17 00:00:00 2001 From: bach Date: Sat, 15 Jul 2023 21:36:44 +0200 Subject: [PATCH] forms are stoping on mouse over #2234 #2150 --- src/components/ConcernementMapItem.vue | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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() },