private void recalculateNodeBounds(){
  float width=getWidth() - 20;
  float height=getHeight() - 20;
  float rootHeight=mRoot.displayInfo.height;
  float rootWidth=mRoot.displayInfo.width;
  float drawScale=Math.min(width / rootWidth,height / rootHeight);
  mDrawShiftX=(int)(getWidth() - drawScale * rootWidth) / 2;
  mDrawShiftY=(int)(getHeight() - drawScale * rootHeight) / 2;
  calculateNodeBounds(mRoot,0,0,1,1,drawScale);
}

private void recalculateNodeBounds ( ) { float width = getWidth ( ) - 20 ; float height = getHeight ( ) - 20 ; float rootHeight = mRoot . displayInfo . height ; float rootWidth = mRoot . displayInfo . width ; float drawScale = Math . min ( width / rootWidth , height / rootHeight ) ; mDrawShiftX = ( int ) ( getWidth ( ) - drawScale * rootWidth ) / 2 ; mDrawShiftY = ( int ) ( getHeight ( ) - drawScale * rootHeight ) / 2 ; calculateNodeBounds ( mRoot , 0 , 0 , 1 , 1 , drawScale ) ; }
recursively initializes the previewbounds of all nodes .
