fixing and cleaning

This commit is contained in:
2023-06-06 15:34:11 +02:00
parent 3b1565c82f
commit 894b0219c5
7 changed files with 175 additions and 92 deletions

View File

@@ -91,8 +91,17 @@ export default {
console.log(`canvas_w: ${canvas_w}, canvas_h: ${canvas_h}`);
this.paper = paper.setup(this.canvasMap.canvas);
// console.log('this.canvasMap.paper', this.canvasMap.paper);
this.canvasMap.canvas.addEventListener('click', this.onCanvasClick);
// // use the paper.view click to get back if no items is clicked
this.paper.view.onClick = function(event) {
console.log("view onClick", this, event.target);
if(event.target._id === "paper-view-0") {
this.resetConcernementOpened();
this.$router.push({
name: 'home',
hash: `#${this.map_mode}`
});
}
}.bind(this);
// MATTER
let wall_w = 100;
@@ -122,17 +131,6 @@ export default {
Matter.Engine.update(this.engine, 1);
window.requestAnimationFrame(this.animate);
},
onCanvasClick(event){
// console.log('onCanvasClick');
// use the canvas click to get back if no items is mousover
if (!this.hover_elmt) {
this.resetConcernementOpened();
this.$router.push({
name: 'home',
hash: `#${this.map_mode}`
});
}
}
},
beforeUpdate () {
},