Scaling and Translating a Shape
The shape is scaled horizontally, scaled vertically, and translated in both dimensions, to fill a given bounding box. The bounding box is represented by specifying an offset in x and y (attributes @x
and @y
of <a:off>
) and extents in x and y (attributes @cx
and @cy
of <a:ext>
, both of which must be greater than or equal to zero). The upper left corner of the bounding box is located at the offset, and the lower right corner of the bounding box is located at the offset plus extent.
If the starting shape has zero width (e.g., it is a vertical line), then the @cx
attribute of <a:ext>
is ignored and the horizontal scaling is skipped. Similarly, if the starting shape has zero height, then the @cy
attribute of <a:ext>
is ignored and the vertical scaling is skipped.
The following XML fragment represents the offset and extents for the star shape above:
<a:xfrm> <a:off x="1866680" y="990600"/> <a:ext cx="1371600" cy="1371600"/> </a:xfrm>
Notice that as demonstrated with the example above, any effects attached to the shape are disregarded when scaling and translating the shape to fill the given bounding box.
This example illustrates that no additional parameters are needed to represent the scaling of a shape. The bounding-box parameters are sufficient to represent scaling. The following XML Fragments represent the offset and extents for a star shape, before and after scaling. In this particular example, the bounding boxes have been chosen to have the same upper-left corner, i.e., the same offset.
Before scaling (small star):
<a:xfrm> <a:off x="1066800" y="990600"/> <a:ext cx="1371600" cy="1371600"/> </a:xfrm>
After scaling (large star):
<a:xfrm> <a:off x="1066800" y="990600"/> <a:ext cx="2438400" cy="2133600"/> </a:xfrm>