Function

CGRectOffset

Returns a rectangle with an origin that is offset from that of the source rectangle.

Declaration

CGRect CGRectOffset(CGRect rect, CGFloat dx, CGFloat dy);

Parameters

rect

The source rectangle.

dx

The offset value for the x-coordinate.

dy

The offset value for the y-coordinate.

Return Value

A rectangle that is the same size as the source, but with its origin offset by dx units along the x-axis and dy units along the y-axis with respect to the source. Returns a null rectangle if rect is a null rectangle.

See Also

Modifying Rectangles

CGRectDivide

Divides a source rectangle into two component rectangles.

CGRectInset

Returns a rectangle that is smaller or larger than the source rectangle, with the same center point.

CGRectIntegral

Returns the smallest rectangle that results from converting the source rectangle values to integers.

CGRectIntersection

Returns the intersection of two rectangles.

CGRectStandardize

Returns a rectangle with a positive width and height.

CGRectUnion

Returns the smallest rectangle that contains the two source rectangles.