def intersection(ir):
        """ Returns a new region that contains the overlapping portion of this region and the specified region (may be None) """
        x = max(self.getX(), ur.getX())
        y = max(self.getY(), ur.getY())
        w = min(self.getBottomRight().x, ur.getBottomRight().x) - x
        h = min(self.getBottomRight().y, ur.getBottomRight().y) - y
        if w > 0 and h > 0:
            return Region(x, y, w, h)
        return None
def intersection ( ir ) : x = max ( self . getX ( ) , ur . getX ( ) ) y = max ( self . getY ( ) , ur . getY ( ) ) w = min ( self . getBottomRight ( ) . x , ur . getBottomRight ( ) . x ) - x h = min ( self . getBottomRight ( ) . y , ur . getBottomRight ( ) . y ) - y if w > 0 and h > 0 : return Region ( x , y , w , h ) return None
Returns a new region that contains the overlapping portion of this region and the specified region (may be None)