public void move(float newX){
  float currWidth=viewportRect.width();
  newX=Math.max(minX - currWidth,Math.min(newX,maxX - currWidth + currWidth));
  viewportRect.left=newX;
  viewportRect.right=newX + currWidth;
}

public void move ( float newX ) { float currWidth = viewportRect . width ( ) ; newX = Math . max ( minX - currWidth , Math . min ( newX , maxX - currWidth + currWidth ) ) ; viewportRect . left = newX ; viewportRect . right = newX + currWidth ; }
move viewport to new x , y
