concernement's entitées are now matter body parts AND mouseoverable & clickable
This commit is contained in:
@@ -105,7 +105,7 @@ export default {
|
||||
this.animate()
|
||||
},
|
||||
methods: {
|
||||
...mapActions(ConcernementsStore,['openCloseConcernement']),
|
||||
...mapActions(ConcernementsStore,['openCloseConcernements']),
|
||||
...mapActions(ConcernementsStore,['resetConcernementOpened']),
|
||||
animate () {
|
||||
this.canvasMap.ctx.clearRect(0, 0, this.canvasMap.canvas.width, this.canvasMap.canvas.height)
|
||||
@@ -115,7 +115,6 @@ export default {
|
||||
},
|
||||
onMouseMove (e) {
|
||||
// check concernement item mouse over
|
||||
// const query = Matter.Query.point(Matter.Composite.allBodies(this.world), this.mouse.position)
|
||||
let query;
|
||||
if (this.opened) {
|
||||
// if a concernement is opened we query the opened concernement's parts (aka entitées bodies)
|
||||
@@ -168,9 +167,8 @@ export default {
|
||||
clickedIDs.push(elmt.id);
|
||||
});
|
||||
// open/close all concernements
|
||||
this.concernements.forEach((concernement, index) => {
|
||||
this.openCloseConcernement(concernement.id, clickedIDs.indexOf(concernement.id) !== -1)
|
||||
});
|
||||
this.openCloseConcernements(clickedIDs)
|
||||
|
||||
// if no concernement opened retrun to home (closing concernement contents opened)
|
||||
// and reset the opened state in concernement store
|
||||
if (!clickedIDs.length) {
|
||||
|
||||
Reference in New Issue
Block a user