public void layoutUp() {
   float off = offset;
   if (father != null) {
     father.offset = off;
     father.layoutUp();
     off += father.getWidthUp();
   }
   if (mother != null) {
     mother.offset = off;
     mother.layoutUp();
     off += mother.getWidthUp();
   }
   if (generation != 0) x = offset + (getWidthUp() - 1) / 2;
 }
 public float getWidthUp() {
   return Math.max(
       1,
       (father != null ? father.getWidthUp() : 0) + (mother != null ? mother.getWidthUp() : 0));
 }