Rect.h
.
void RctCopyRectangle (const RectangleType* srcRectP, RectangleType* dstRectP)
  |
|
A pointer to the rectangle to be copied. |
  |
|
A pointer to the destination rectangle. |
RctSetRectangle
void RctGetIntersection (const RectangleType* r1P, const RectangleType* r2P, RectangleType* r3P)
  |
|
A pointer to a source rectangle. |
  |
|
A pointer to the other source rectangle. |
  |
|
Upon return, points to a rectangle representing the intersection of r1 and r2 . |
RectangleType
, which is pointed to by RectanglePtr
, stores the coordinates for the top-left corner of the rectangle plus the rectangle's width and height. This function returns in the r3
parameter a pointer to the rectangle that represents the intersection of the first two rectangles.
r1
and r2
do not intersect, r3
contains a rectangle that begins at coordinates (0, 0) and has 0 width and 0 height.
void RctInsetRectangle (RectangleType* rP, Coord insetAmt)
  |
|
A pointer to the rectangle. |
  |
|
Number of pixels to move the boundaries. This can be a negative number. |
RectangleType
, which is pointed to by RectanglePtr
, stores the coordinates for the top-left corner of the rectangle plus the rectangle's width and height. This function adds insetAmt
to the x and y values of the top-left coordinate and then adjusts the width and the height accordingly so that all of the sides of the rectangle are contracted or expanded by the same amount.
insetAmt
creates a smaller rectangle that is contained inside the old rectangle's boundaries. A negative insetAmt
creates a larger rectangle that surrounds the old rectangle.
RctOffsetRectangle
void RctOffsetRectangle (RectangleType* rP, Coord deltaX, Coord deltaY)
  |
|
A pointer to the rectangle. |
  |
|
Number of pixels to move the left boundary. This can be a negative number. |
  |
|
Number of pixels to move the top boundary. This can be a negative number. |
RectangleType
, which is pointed to by RectanglePtr
, stores the coordinates for the top-left corner of the rectangle plus the rectangle's width and height. This function adds deltaX
to the x value of the top-left coordinate and deltaY
to the y value. The width and height are unchanged. Thus, this function shifts the position of the rectangle by the deltaX
and deltaY
amounts.
RctInsetRectangle
Boolean RctPtInRectangle (Coord x, Coord y, const RectangleType* rP)
  |
|
The x coordinate of the point. |
  |
|
The y coordinate of the point. |
  |
|
The rectangle. |
true
if the point (x
, y
) lies within the boundaries of rectangle r
, false
otherwise.
void RctSetRectangle (RectangleType* rP, Coord left, Coord top, Coord width, Coord height)
  |
|
A pointer to the rectangle to be set. |
  |
|
The x value for the top-left coordinate of the rectangle. |
  |
|
The y value for the top-left coordinate of the rectangle. |
  |
|
The rectangle's width. |
  |
|
The rectangle's height. |
RctCopyRectangle
  |   |