Carbon


Rect

Header: MacTypes.h

struct Rect {
    SInt16 top; 
    SInt16 left; 
    SInt16 bottom; 
    SInt16 right;
};
typedef Rect ListBounds;

Field descriptions

top

The vertical coordinate of the upper-left point of the rectangle.

left

The horizontal coordinate of the upper-left point of the rectangle.

bottom

The vertical coordinate of the lower-right point of the rectangle.

right

The horizontal coordinate of the lower-right point of the rectangle.

You can use a rectangle, which is a data structure of type Rect, to define areas on the screen and to specify the locations and sizes for various graphics operations. For example, a port rectangle represents the area of a graphics port available for drawing.

The Rect data type can be defined by two points or four integers. The two points define the upper-left and lower-right corners of a rectangle; the four integers define the vertical and horizontal coordinates of the two points.

Note that while the vertical coordinate appears first in this data structure, followed by the horizontal coordinate, the parameters to all QuickDraw functions expect the horizontal coordinate first and the vertical coordinate second.


© 2000 Apple Computer, Inc. (Last Updated 6/26/2000)