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: QuickDraw GX Environment and Utilities /
Chapter 8 - QuickDraw GX Mathematics / QuickDraw GX Mathematics Reference
Mapping Functions / Modifying Mappings


SkewMapping

You can use the SkewMapping function to change the horizontal and vertical skew specified by a mapping.

gxMapping *SkewMapping(gxMapping target, 
                        Fixed skewX, Fixed skewY, 
                        Fixed xCenter, Fixed yCenter);
target
A pointer to the mapping that is to be modified. On return, points to the modified mapping.
skewX
The scaling factor that determines the amount of skew in the x direction. A value of 0 means no horizontal skew.
skewY
The scaling factor that determines the amount of skew in the y direction. A value of 0 means no vertical skew.
xCenter
The x-coordinate of the center of skewing.
yCenter
The y-coordinate of the center of skewing.
function result
A pointer to the modified mapping, which is also the target mapping.
DESCRIPTION
The SkewMapping function postmultiplies the target mapping by a mapping that specifies a horizontal skew factor of skewX and a vertical skew factor of skewY, about the point (xCenter, yCenter). Note that if skewX is 0, yCenter irrelevant; likewise, if skewY is 0, xCenter is irrelevant.

These skew factors are in addition to any preexisting skew specified in the target mapping. The center of skewing specifies the point at which no translation takes place because of the skewing.

Passing the result of the SkewMapping function to the GXMapShape function is equivalent to calling the GXMapShape function and then calling the GXSkewShape function. For example, you could make these calls (for the shape s):

SkewMapping(target, hFactor, vFactor, xCenter, yCenter);
GXMapShape(s, target);
or, you could make these equivalent calls:

GXMapShape(s, target);
GXSkewShape(s, skewX, skewY, xCenter, yCenter);
ERRORS, WARNINGS, AND NOTICES
Errors
mapping_is_nil
SEE ALSO
The use of the SkewMapping function is described in the section "Skewing" beginning on page 8-24.

The GXMapShape and GXSkewShape functions are described in the chapter "Transform Objects" in Inside Macintosh: QuickDraw GX Objects.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996