More code cleanup

This commit is contained in:
Anuken
2019-03-24 21:10:59 -04:00
parent 97f5bf3cc4
commit 71c2c7ad05
25 changed files with 28 additions and 12 deletions

View File

@@ -237,9 +237,8 @@ public class TreeLayout{
}
executeShifts(v);
float midpoint = (v.children[0].prelim + v.children[v.children.length-1].prelim) / 2f;
TreeNode w = leftSibling;
if(w != null){
v.prelim = w.prelim + getDistance(v, w);
if(leftSibling != null){
v.prelim = leftSibling.prelim + getDistance(v, leftSibling);
v.mode = v.prelim - midpoint;
}else{
v.prelim = midpoint;