SetOrigin
SetOrigin Change the local coordinate system
#include <Quickdraw.h> Quickdraw
void SetOrigin(hOrigin, vOrigin );
short hOrigin ; new local coordinate for left side
short vOrigin ; new local coordinate for top
SetOrigin re defines the local coordinate system for the active GrafPort. It
is often used after scrolling and it can simplify some drawing operations.
vOrigin and . . .
hOrigin are local screen coordinates. After the call, the top-left corner of
the GrafPort's portRect will be at these coordinates.
Returns: none

Notes: SetOrigin does not affect the screen image. It does affect all subsequent
drawing and other operations that use the local coordinate system. Observe:
The figure on the left shows the local coordinate plane as it is initially.
The dot at point A is at local coordinates (10,10).
The SetOrigin(-20,0) call slides the coordinate system toward the right.
The dot at point A is now at (-10,10). A new dot drawn at (10,10) would
appear at point B, 20 points to the right of the dot originally drawn at
(10,10).
One way of looking at this is to say the SetOrigin causes Quickdraw to
subtract hOrigin and vOrigin from the coordinates of all subsequent
drawing commands.
Here's a typical use for this command: Suppose you have a routine that
draws a figure starting at (0,0). If you want that same figure drawn at, say
(20,30), you could use SetOrigin(-20,-30), then call the
figure-drawing routine. Upon return, you may wish to SetOrigin(0,0),
to get back to normal.
Another useful technique is to set a left- and top-border for all operations.
For instance:
SetOrigin( -leftBorder, -topBorder );
would set local coordinate (0,0) to be at (leftBorder,topBorder) and
subsequent drawing at positive coordinates would be offset from the edge of
the GrafPort.
Note that the GrafPort's clipRgn and the pnLoc stick to the coordinate
system, and therefore appear to move, relative to the drawings on the
screen. The portBits.bounds, portRect, and visRgn stick to the screen and
are not changed by this call. They remain stationary with respect to the
screen contents.