Code example for Region

Methods: op

0
        if (mRegion.isEmpty()) {
            return false; 
        } 
        Rect rect = new Rect();
        RegionIterator iterator = new RegionIterator(mRegion);
        Region region = new Region(mRegion);
        float tmpx, tmpy, tmpw, tmph;
         
        while (iterator.next(rect)) {
            if (x < width + x) {
                tmpx = x;
                tmpw = width;
            } 
            else{ 
                tmpx = width + x;
                tmpw = Math.abs(width); 
            } 
            if (y < height + y) {
                tmpy = y;
                tmph = height;
            } 
            else{ 
                tmpy = height + y;
                tmph = Math.abs(height); 
            } 
            return region.op((int)tmpx, (int)tmpy, (int)(tmpx + tmpw), (int)(tmpy + tmph), Op.INTERSECT);
        } 
        return false; 
    } 
 
    /** 
Stop searching for code, let great code find you!  Add Codota to your java IDE