Code example for Rect

Methods: heightsetwidth

0
     */ 
    private void updateSourcePartial() { 
        mSource.getHitRect(mScrap);
        if (!mScrap.equals(mSourceFull)) {
            // Copy over and calculate fractional rectangle 
            mSourceFull.set(mScrap);
 
            final int width = mSourceFull.width();
            final int height = mSourceFull.height();
 
            mSourcePartial.left = (int) (mSourceFraction.left * width);
            mSourcePartial.top = (int) (mSourceFraction.top * height);
            mSourcePartial.right = (int) (mSourceFraction.right * width);
            mSourcePartial.bottom = (int) (mSourceFraction.bottom * height);
        } 
    } 
 
    @Override 
    public boolean onTouchEvent(MotionEvent event) {
        updateSourcePartial();