private void adjustView(){
  if ((dvx == 0) && (dvy == 0)) {
    return;
  }
  final int sx=convertWorldXToScaledScreen(x) - getScreenViewX() + SIZE_UNIT_PIXELS / 2;
  final int sy=convertWorldYToScaledScreen(y) - getScreenViewY() + SIZE_UNIT_PIXELS / 2;
  if ((sx < 0) || (sx >= sw) || (sy < -SIZE_UNIT_PIXELS)|| (sy > sh)) {
    center();
  }
 else {
    calculatePanningSpeed();
    if (speed != 0) {
      final int scalediv=(Math.abs(dvx) + Math.abs(dvy)) * PAN_SCALE;
      int dx=speed * dvx / scalediv;
      int dy=speed * dvy / scalediv;
      if (dvx < 0) {
        dx=MathHelper.clamp(dx,dvx,-1);
      }
 else       if (dvx > 0) {
        dx=MathHelper.clamp(dx,1,dvx);
      }
      if (dvy < 0) {
        dy=MathHelper.clamp(dy,dvy,-1);
      }
 else       if (dvy > 0) {
        dy=MathHelper.clamp(dy,1,dvy);
      }
      svx+=dx;
      dvx-=dx;
      svy+=dy;
      dvy-=dy;
    }
  }
}

private void adjustView ( ) { if ( ( dvx == 0 ) && ( dvy == 0 ) ) { return ; } final int sx = convertWorldXToScaledScreen ( x ) - getScreenViewX ( ) + SIZE_UNIT_PIXELS / 2 ; final int sy = convertWorldYToScaledScreen ( y ) - getScreenViewY ( ) + SIZE_UNIT_PIXELS / 2 ; if ( ( sx < 0 ) || ( sx >= sw ) || ( sy < - SIZE_UNIT_PIXELS ) || ( sy > sh ) ) { center ( ) ; } else { calculatePanningSpeed ( ) ; if ( speed != 0 ) { final int scalediv = ( Math . abs ( dvx ) + Math . abs ( dvy ) ) * PAN_SCALE ; int dx = speed * dvx / scalediv ; int dy = speed * dvy / scalediv ; if ( dvx < 0 ) { dx = MathHelper . clamp ( dx , dvx , - 1 ) ; } else if ( dvx > 0 ) { dx = MathHelper . clamp ( dx , 1 , dvx ) ; } if ( dvy < 0 ) { dy = MathHelper . clamp ( dy , dvy , - 1 ) ; } else if ( dvy > 0 ) { dy = MathHelper . clamp ( dy , 1 , dvy ) ; } svx += dx ; dvx -= dx ; svy += dy ; dvy -= dy ; } } }
update the view position to center the target position .
