Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Macintosh Toolbox Essentials /
Chapter 4 - Window Manager / Window Manager Reference
Window Manager Routines / Moving Windows


PinRect

The DragGrayRgn function uses the PinRect function to contain a point within a specified rectangle.

FUNCTION PinRect (theRect: Rect; thePt: Point): LongInt;
theRect
The rectangle in which the point is to be contained.
thePt
The point to be contained.
DESCRIPTION
The PinRect function returns a point within the specified rectangle that is as close as possible to the specified point. (The high-order word of the returned long integer is the vertical coordinate; the low-order word is the horizontal coordinate.)

If the specified point is within the rectangle, PinRect returns the point itself. If not, then

Note
The 1 is subtracted when the point is below or to the right of the rectangle so that a pixel drawn at that point lies within the rectangle. If the point is exactly on the bottom or the right edge of the rectangle, however, 1 should be subtracted but isn't.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
11 JUL 1996