Code example for Rect

Methods: insetunion

0
        } 
    } 
 
    // Grows the cropping rectange by (dx, dy) in image space. 
    void moveBy(float dx, float dy) {
        Rect invalRect = new Rect(mDrawRect);
 
        mCropRect.offset(dx, dy);
 
        // Put the cropping rectangle inside image rectangle. 
        mCropRect.offset(Math.max(0, mImageRect.left - mCropRect.left), Math
                .max(0, mImageRect.top - mCropRect.top));
 
        mCropRect.offset(Math.min(0, mImageRect.right - mCropRect.right), Math
                .min(0, mImageRect.bottom - mCropRect.bottom));
 
        mDrawRect = computeLayout();
        invalRect.union(mDrawRect);
        invalRect.inset(-10, -10);
        mContext.invalidate(invalRect);
    } 
 
    // Grows the cropping rectange by (dx, dy) in image space. 
    void growBy(float dx, float dy) {