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


ScaleMapping

You can use the ScaleMapping function to change the horizontal and vertical scale factors of a mapping.

gxMapping *ScaleMapping(gxMapping *target, 
                        Fixed hFactor, Fixed vFactor, 
                        Fixed xCenter, Fixed yCenter);
target
A pointer to the mapping that is to be modified. On return, points to the modified mapping.
hFactor
The horizontal scaling factor to apply. A value of 1.0 means no scale change in the x direction.
vFactor
The vertical scaling factor to apply. A value of 1.0 means no scale change in the y direction.
xCenter
The x-coordinate of the center of scaling.
yCenter
The y-coordinate of the center of scaling.
function result
A pointer to the modified mapping, which is also the target mapping.
DESCRIPTION
The ScaleMapping function postmultiplies the target mapping by a mapping that specifies a horizontal scaling factor of hFactor and a vertical scaling factor of vFactor, about the point (xCenter, yCenter). Note that if hFactor is 1, xCenter irrelevant; likewise, if vFactor is 1, yCenter is irrelevant.

These scaling factors are in addition to any preexisting scaling factors in the target mapping. The center of scaling is the point that does not move when the scaling is applied.

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

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

GXMapShape(s, target);
GXScaleShape(s, hFactor, vFactor, xCenter, yCenter);
ERRORS, WARNINGS, AND NOTICES
Errors
mapping_is_nil
SEE ALSO
The use of the ScaleMapping function is described in the section "Scaling" beginning on page 8-20.

The GXMapShape and GXScaleShape 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