Collision checking implemented

This commit is contained in:
Gonzalo Bellver
2012-01-16 18:37:01 -03:00
parent 039b5d8c8a
commit 3f83bf95ea
5 changed files with 93 additions and 7 deletions

View File

@@ -157,6 +157,11 @@ mindplot.layout.Node = new Class({
return this._sorter;
},
getVertex: function() {
var a = {x: this.getPosition().x - this.getSize().width/2, y:this.getPosition().y - this.getSize().height/2};
var b = {x: this.getPosition().x + this.getSize().width/2, y:this.getPosition().y + this.getSize().height/2};
return {a:a, b:b};
},
toString: function() {
return "[id:" + this.getId() + ", order:" + this.getOrder() + ", position: {" + this.getPosition().x + "," + this.getPosition().y + "}, size: {" + this.getSize().width + "}," + this.getSize().height + ", shrink:" + this.areChildrenShrunken() + "]";