Function Summary | |
---|---|
BOOL | CGRectContainsRect(lhsRect, rhsRect) Returns a BOOL indicating whether CGRect lhsRect
contains CGRect rhsRect . |
BOOL | CGRectIntersectsRect(lhsRect, rhsRect) Returns YES if the two rectangles intersect. |
CGRect | CGRectIntegral(aRect) Makes the origin and size of a CGRect all integers. |
CGRect | CGRectIntersection(lhsRect, rhsRect) Returns the intersection of the two provided rectangles as a new rectangle. |
CGRect | CPRectInset(aRect, dX, dY) Makes a CGRect with an origin and size equal to aRect less the dX/dY insets specified. |
CGRect | CPRectIntersection(lhsRect, rhsRect) Returns the intersection of the two provided rectangles as a new rectangle. |
CGRect | CPRectCreateCopy(aRect) Creates a copy of the provided rectangle. |
CGRect | CPRectMake(x, y, width, height) Returns a CGRect made of the specified arguments. |
CGRect | CPRectOffset(aRect, dX, dY) Creates a new rectangle with its origin offset by dX and dY . |
CGRect | CPRectStandardize(aRect) |
CGRect | CPRectUnion(lhsRect, rhsRect) Returns the smallest rectangle that can contain the two argument CGRect s. |
BOOL | CPRectContainsPoint(aRect, aPoint) Returns YES if the CGRect , aRect , contains
the CGPoint , aPoint . |
BOOL | CPRectContainsRect(lhsRect, rhsRect) Returns a BOOL indicating whether CGRect possibleOuter
contains CGRect possibleInner . |
BOOL | CPRectEqualToRect(lhsRect, rhsRect) Test whether the two CGRect s have the same origin and size. |
int | CPRectGetHeight(aRect) |
int | CPRectGetMaxX(aRect) |
int | CPRectGetMaxY(aRect) |
float | CPRectGetMidX(aRect) |
float | CPRectGetMidY(aRect) |
int | CPRectGetMinX(aRect) |
int | CPRectGetMinY(aRect) |
int | CPRectGetWidth(aRect) |
BOOL | CPRectIntersectsRect(lhsRect, rhsRect) Returns YES if the two rectangles intersect. |
BOOL | CPRectIsEmpty(aRect) Returns YES if the CGRect has no area. |
BOOL | CPRectIsNull(aRect) Returns YES if the CGRect has no area. |
CGString | CPStringFromRect(aRect) Returns a human readable string of the provided CGRect . |
CGRect | CPRectFromString(aString) Returns a CGRect created from a string. |
CGRect | CPRectMakeZero() Returns a rectangle at origin (0,0) and size of (0,0) . |
Function Detail |
---|
function CGRectContainsRect(lhsRect, rhsRect)
BOOL
indicating whether CGRect
lhsRect
contains CGRect
rhsRect
.lhsRect
- the CGRect
to test if rhsRect
is inside ofrhsRect
- the CGRect
to test if it fits inside lhsRect
.YES
if rhsRect
fits inside lhsRect
.function CGRectIntersectsRect(lhsRect, rhsRect)
YES
if the two rectangles intersectlhsRect
- the first CGRect
rhsRect
- the second CGRect
YES
if the two rectangles have any common spaces, and NO
, otherwise.function CGRectIntegral(aRect)
CGRect
all integers. Specifically, by making
the southwest corner the origin (rounded down), and the northeast corner a CGSize
(rounded up).aRect
- the rectangle to operate onfunction CGRectIntersection(lhsRect, rhsRect)
lhsRect
- the first rectangle used for calculationrhsRect
- the second rectangle used for calculationfunction CPRectInset(aRect, dX, dY)
aRect
less the dX/dY
insets specified.aRect
dX
- the size of the inset in the x-axisdY
- the size of the inset in the y-axisaRect
with an insetfunction CPRectIntersection(lhsRect, rhsRect)
lhsRect
- the first rectangle used for calculationrhsRect
- the second rectangle used for calculationfunction CPRectCreateCopy(aRect)
aRect
- the CGRect that will be copiedfunction CPRectMake(x, y, width, height)
x
- the x-coordinate of the rectangle's originy
- the y-coordinate of the rectangle's originwidth
- the width of the new rectangleheight
- the height of the new rectanglefunction CPRectOffset(aRect, dX, dY)
dX
and dY
.aRect
- the rectangle to copy the origin and size fromdX
- the amount added to the x-size of the new rectangledY
- the amount added to the y-size of the new rectanglefunction CPRectStandardize(aRect)
aRect
- a CGRectfunction CPRectUnion(lhsRect, rhsRect)
CGRect
s.lhsRect
- the first CGRect to use for the union calculationrhsRect
- the second CGRect to use for the union calculationfunction CPRectContainsPoint(aRect, aPoint)
YES
if the CGRect
, aRect
, contains
the CGPoint
, aPoint
.aRect
- the rectangle to test withaPoint
- the point to test withYES
if the rectangle contains the point, NO
otherwise.function CPRectContainsRect(lhsRect, rhsRect)
BOOL
indicating whether CGRect
possibleOuter
contains CGRect
possibleInner
.lhsRect
rhsRect
YES
if possibleInner
fits inside possibleOuter
.function CPRectEqualToRect(lhsRect, rhsRect)
CGRect
s have the same origin and sizelhsRect
- the first CGRect
to comparerhsRect
- the second CGRect
to compareYES
if the two rectangles have the same origin and size. NO
, otherwise.function CPRectGetHeight(aRect)
aRect
- a CGRect
function CPRectGetMaxX(aRect)
aRect
- a CGRect
function CPRectGetMaxY(aRect)
aRect
- a CGRect
function CPRectGetMidX(aRect)
aRect
- a CGRect
function CPRectGetMidY(aRect)
aRect
- a CGRect
function CPRectGetMinX(aRect)
aRect
- a CGRect
function CPRectGetMinY(aRect)
aRect
- a CGRect
function CPRectGetWidth(aRect)
aRect
- a CGRect
function CPRectIntersectsRect(lhsRect, rhsRect)
YES
if the two rectangles intersectlhsRect
- the first CGRect
rhsRect
- the second CGRect
YES
if the two rectangles have any common spaces, and NO
, otherwise.function CPRectIsEmpty(aRect)
YES
if the CGRect
has no area.
The test is performed by checking if the width and height are both zero.aRect
- the CGRect
to testYES
if the CGRect
has no area, and NO
, otherwise.function CPRectIsNull(aRect)
YES
if the CGRect
has no area.
The test is performed by checking if the width and height are both zero.aRect
YES
if the CGRect
has no area, and NO
, otherwise.function CPStringFromRect(aRect)
CGRect
.aRect
- the rectangle to representfunction CPRectFromString(aString)
CGRect
created from a string.aString
- a string in the form generated by CPStringFromRect
function CPRectMakeZero()
(0,0)
and size of (0,0)
.