Code example for Region

Methods: op

0
     
    /** 
     * {@inheritDoc}  
     */ 
    public boolean intersects(float x, float y, float width, float height) {
        Region region = new Region(mRegion);
        float tmpx, tmpy, tmpw, tmph;
 
        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);
    } 
 
    /** 
     * {@inheritDoc}  
     */