|
@@ -755,9 +755,18 @@
|
|
|
function moveEvolutionZone(l, r){
|
|
|
var left = l || 0;
|
|
|
var right = r || 0;
|
|
|
- _evolution_zone.left = Math.max(_scene_props.width/5, left+20);
|
|
|
- _evolution_zone.right = Math.min(_scene_props.width - _scene_props.width/5, _scene_props.width-right+20);
|
|
|
+ console.log("moveEvolutionZone",left,right);
|
|
|
+ console.log("_scene_props", _scene_props);
|
|
|
+ _evolution_zone.left =
|
|
|
+ left == 0
|
|
|
+ ? left+20
|
|
|
+ : Math.max(_scene_props.width/5, left+20);
|
|
|
+ _evolution_zone.right =
|
|
|
+ right == 0
|
|
|
+ ? _scene_props.width-right+20
|
|
|
+ : Math.min(_scene_props.width - _scene_props.width/5, _scene_props.width-right+20);
|
|
|
_evolution_zone.center = _evolution_zone.left + (_evolution_zone.right - _evolution_zone.left)/2;
|
|
|
+ console.log("moveEvolutionZone",_evolution_zone);
|
|
|
// move _attracter to the center of the zone
|
|
|
resizePhysics();
|
|
|
}
|
|
@@ -1185,11 +1194,24 @@
|
|
|
};
|
|
|
|
|
|
NodePopUp.prototype.setPositioning = function(){
|
|
|
+ // switch(true){
|
|
|
+ // case this.node.x > this.node.wall_limits.right-350-_evolution_zone.right && this.node.y < this.node.wall_limits.top+200:
|
|
|
+ // this.$dom.attr('pos', 'bottom-left');
|
|
|
+ // break;
|
|
|
+ // case this.node.x > this.node.wall_limits.right-350-_evolution_zone.right:
|
|
|
+ // this.$dom.attr('pos', 'top-left');
|
|
|
+ // break;
|
|
|
+ // case this.node.y < this.node.wall_limits.top+200:
|
|
|
+ // this.$dom.attr('pos', 'bottom-right');
|
|
|
+ // break;
|
|
|
+ // default:
|
|
|
+ // this.$dom.attr('pos', 'top-right');
|
|
|
+ // }
|
|
|
switch(true){
|
|
|
- case this.node.x > this.node.wall_limits.right-350 && this.node.y < this.node.wall_limits.top+200:
|
|
|
+ case this.node.x > _evolution_zone.right-350 && this.node.y < this.node.wall_limits.top+200:
|
|
|
this.$dom.attr('pos', 'bottom-left');
|
|
|
break;
|
|
|
- case this.node.x > this.node.wall_limits.right-350:
|
|
|
+ case this.node.x > _evolution_zone.right-350:
|
|
|
this.$dom.attr('pos', 'top-left');
|
|
|
break;
|
|
|
case this.node.y < this.node.wall_limits.top+200:
|