public static CGRectContainsRect ( |
||
rect1 | The rectangle to examine for containment of the rectangle passed in rect2. | |
rect2 | The rectangle to examine for being contained in the rectangle passed in rect1. | |
return | int |
public static int CGRectContainsRect(CGRect rect1, CGRect rect2)
{
return ((CGRectIsEmpty(rect2) == 0) &&
(CGRectGetMinX(rect1) <= CGRectGetMinX((rect2))) &&
(CGRectGetMinY(rect1) <= CGRectGetMinY((rect2))) &&
(CGRectGetMaxX(rect1) >= CGRectGetMaxX((rect2))) &&
(CGRectGetMaxY(rect1) >= CGRectGetMaxY((rect2)))) ? 1 : 0;
}