MapRect
MapRect Scale and reposition a rectangle Rect *theRect ; address of rectangle to map; receives result Rect *destRect ; address of Rect to convert to MapRect maps the corner points of a rectangle, converting them by a size ratio and offset of two other rectangles. Use this to scale or reposition an
object that is being moved to a larger or smaller rectangle.
theRect is the address of an 8-byte Rect structure. On entry, it describes a rectangle within srcRect that you wish to remap. Upon return, its corner points have been recalculated relative to the size and position
of destRect .
destRect are the addresses of two 8-byte Rect structures. For typical operations, theRect is an element of an object enclosed by srcRect . It gets mapped to a similar position within destRect .
Notes: Use this function to resize and reposition a rectangle that you wish to
expand or shrink as you move it from one rectangular area to an other
(typically smaller or larger) one.
theRect is expanded or shrunk by the ratio of the sizes of srcRect and destRect. It is moved to a similarly-located position within destRect . This
is a purely mathematical operation and has no effect on the screen until
theRect is subsequently drawn or filled.
This call is functionally equivalent to:
MapPt( & topleft( theRect), & srcRect, &destRect ); MapPt( & bottomRight( theRect), & srcRect, &destRect );