private void limitRectCoords(GrowableRectArray rects,int index){
  if ((rects.getX(index) + rects.getWidth(index)) > MASK_SIZE) {
    rects.setWidth(index,MASK_SIZE - rects.getX(index));
  }
  if ((rects.getY(index) + rects.getHeight(index)) > MASK_SIZE) {
    rects.setHeight(index,MASK_SIZE - rects.getY(index));
  }
  if (rects.getX(index) < 0) {
    rects.setWidth(index,rects.getWidth(index) + rects.getX(index));
    rects.setX(index,0);
  }
  if (rects.getY(index) < 0) {
    rects.setHeight(index,rects.getHeight(index) + rects.getY(index));
    rects.setY(index,0);
  }
}

private void limitRectCoords ( GrowableRectArray rects , int index ) { if ( ( rects . getX ( index ) + rects . getWidth ( index ) ) > MASK_SIZE ) { rects . setWidth ( index , MASK_SIZE - rects . getX ( index ) ) ; } if ( ( rects . getY ( index ) + rects . getHeight ( index ) ) > MASK_SIZE ) { rects . setHeight ( index , MASK_SIZE - rects . getY ( index ) ) ; } if ( rects . getX ( index ) < 0 ) { rects . setWidth ( index , rects . getWidth ( index ) + rects . getX ( index ) ) ; rects . setX ( index , 0 ) ; } if ( rects . getY ( index ) < 0 ) { rects . setHeight ( index , rects . getHeight ( index ) + rects . getY ( index ) ) ; rects . setY ( index , 0 ) ; } }
limits the rect ' s coordinates to the mask coordinates . the result is used by growdirtyregion .
