Code example for Region

Methods: contains

0
 
    /** 
     * {@inheritDoc}  
     */ 
    public boolean contains(RectShape rect) {
        if (this.mRegion.contains((int)rect.getMinX(), (int)rect.getMinY()) &&
                this.mRegion.contains((int)rect.getMinX(), (int)(rect.getMaxY())) &&
                this.mRegion.contains((int)(rect.getMaxX()), (int)rect.getMinY()) &&
                this.mRegion.contains((int)(rect.getMaxX()), (int)(rect.getMaxY())) 
                ) { 
            return true; 
        } 
        return false; 
    } 
 
    /** 
     * {@inheritDoc}  
     */ 
    public boolean contains(float x, float y) {
        return mRegion.contains((int)x, (int)y);
    }