Fixed branch overlapping bug

This commit is contained in:
Gonzalo Bellver
2012-03-06 18:01:56 -03:00
parent dc4f47ab7a
commit 6506b60977
4 changed files with 50 additions and 14 deletions

View File

@@ -157,7 +157,8 @@ mindplot.layout.OriginalLayout = new Class({
}, this);
if (!sibling.isFree() || overlappingOccurs) {
this._treeSet.shiftBranchPosition(sibling, 0, node.getFreeDisplacement().y);
var sAmount = node.getFreeDisplacement().y;
this._treeSet.shiftBranchPosition(sibling, 0, sAmount);
shiftedBranches.push(sibling);
}
}, this);
@@ -167,14 +168,9 @@ mindplot.layout.OriginalLayout = new Class({
});
branchesToShift.forEach(function(branch) {
var overlappingOccurs = shiftedBranches.some(function(shiftedBranch) {
return this._branchesOverlap(shiftedBranch, branch, heightById);
}, this);
if (overlappingOccurs) {
this._treeSet.shiftBranchPosition(branch, 0, node.getFreeDisplacement().y);
shiftedBranches.push(branch);
}
var bAmount = node.getFreeDisplacement().y;
this._treeSet.shiftBranchPosition(branch, 0, bAmount);
shiftedBranches.push(branch);
last = branch;
},this);
},

View File

@@ -176,6 +176,10 @@ mindplot.layout.SymmetricSorter = new Class({
toString:function() {
return "Symmetric Sorter";
},
_getVerticalPadding: function() {
return mindplot.layout.SymmetricSorter.INTERNODE_VERTICAL_PADDING;
}
});