EqualRect
Rect *rect1 ; rectangles . . . Rect *rect2 ; . . . to compare returns Are the rectangles the same size and position?
EqualRect compares the border coordinates of two rectangles and returns TRUE if they are identical. To be considered equal, the rectangles must be the same size and position and be defined in the same coordinate system.
rect1 and . . .
rect2 are addresses of two rectangles, using the same coordinate system.
Returns: a Boolean value indicating whether or not the two rectangles are identical. It is one of:
Notes: This is functionally equivalent to the following equality test:
if ( (r1.top==r2.top) && (r1.left==r2.left) &&
(r1.bottom==r2.bottom) && (r1.right==r2.right) ) {
... they are equal ...
}
or the more efficient:
if ( (*(long *)&r1.top == *(long *)&r2.top) && /* top and left */
(*(long *)&r1.bottom == *(long *)&r2.bottom) ) { /* btm, right*/
... they are equal ...
}
If the rectangles are expressed in two different coordinate systems, use
before comparing.