better mouseover mapitem mvt stop
This commit is contained in:
@@ -1191,34 +1191,36 @@ export default {
|
||||
|
||||
},
|
||||
onAfterEngineUpdate(){
|
||||
|
||||
// // START OF DEBUGGING
|
||||
// // draw lines of constraints for debuging
|
||||
// let constraints_lines = this.paper.project.getItem({name: 'constraints_lines', class: paper.Group});
|
||||
// if (constraints_lines) {
|
||||
// constraints_lines.removeChildren();
|
||||
// }else{
|
||||
// constraints_lines = new paper.Group({
|
||||
// pivot: new paper.Point({x:0,y:0}),
|
||||
// name: 'constraints_lines',
|
||||
// });
|
||||
// }
|
||||
// let all_constrains = Matter.Composite.allConstraints(this.world);
|
||||
// let children = [];
|
||||
// for(let constraint of all_constrains){
|
||||
// // console.log('constrain', constraint);
|
||||
// let pointAWorld = Matter.Constraint.pointAWorld(constraint);
|
||||
// let pointBWorld = Matter.Constraint.pointBWorld(constraint);
|
||||
// // console.log('pointAWorld, pointBWorld', pointAWorld, pointBWorld);
|
||||
// children.push(new paper.Path.Line({
|
||||
// from: [pointAWorld.x, pointAWorld.y],
|
||||
// to: [pointBWorld.x, pointBWorld.y],
|
||||
// strokeColor: '#f00',
|
||||
// strokeWidth: 1
|
||||
// }));
|
||||
// }
|
||||
// constraints_lines.addChildren(children);
|
||||
// this.debugDrawConstraints()
|
||||
// // END OF DEBUGGING
|
||||
},
|
||||
debugDrawConstraints(){
|
||||
// draw lines of constraints for debuging
|
||||
let constraints_lines = this.paper.project.getItem({name: 'constraints_lines', class: paper.Group});
|
||||
if (constraints_lines) {
|
||||
constraints_lines.removeChildren();
|
||||
}else{
|
||||
constraints_lines = new paper.Group({
|
||||
pivot: new paper.Point({x:0,y:0}),
|
||||
name: 'constraints_lines',
|
||||
});
|
||||
}
|
||||
let all_constrains = Matter.Composite.allConstraints(this.world);
|
||||
let children = [];
|
||||
for(let constraint of all_constrains){
|
||||
// console.log('constrain', constraint);
|
||||
let pointAWorld = Matter.Constraint.pointAWorld(constraint);
|
||||
let pointBWorld = Matter.Constraint.pointBWorld(constraint);
|
||||
// console.log('pointAWorld, pointBWorld', pointAWorld, pointBWorld);
|
||||
children.push(new paper.Path.Line({
|
||||
from: [pointAWorld.x, pointAWorld.y],
|
||||
to: [pointBWorld.x, pointBWorld.y],
|
||||
strokeColor: '#f00',
|
||||
strokeWidth: 1
|
||||
}));
|
||||
}
|
||||
constraints_lines.addChildren(children);
|
||||
}
|
||||
},
|
||||
beforeUpdate () {
|
||||
|
||||
Reference in New Issue
Block a user