public static int height(final Segment document,final int maxWidth,final FontRenderer renderer){
  int currentX=0;
  int currentY=0;
  Segment segment=document;
  while (segment != null) {
    currentY+=segment.nextY(currentX,maxWidth,renderer);
    currentX=segment.nextX(currentX,maxWidth,renderer);
    segment=segment.next();
  }
  return currentY;
}

public static int height ( final Segment document , final int maxWidth , final FontRenderer renderer ) { int currentX = 0 ; int currentY = 0 ; Segment segment = document ; while ( segment != null ) { currentY += segment . nextY ( currentX , maxWidth , renderer ) ; currentX = segment . nextX ( currentX , maxWidth , renderer ) ; segment = segment . next ( ) ; } return currentY ; }
compute the overall height of a document , e . g . for computation of scroll offsets .
