Scaling and Translating a Group

The group is scaled horizontally, scaled vertically, and translated in both dimensions. The parameters are chosen to transform the child bounding box (specified by <a:chOff> and <a:chExt>) to the group bounding box (specified by <a:off> and <a:ext>). The child bounding box is defined as the bounding box around the group's children as they would have been had their @rot attributes been absent.

It is possible for the child bounding box to have a zero value for @cx or @cy in <a:chExt>, e.g., because the starting shape is a horizontal or vertical line, or because the starting shape was scaled to have zero width or height. Such a case is handled in the same way as previously described for simple shapes.

This example demonstrates the definition of the child bounding box. The two shapes on the left, rotated squares, are grouped. The two shapes on the right, non-rotated squares, are also grouped.

The red bands are not part of the drawing; each represents the child bounding box of a group. In the XML fragments, the child bounding boxes have identical y values, illustrating that they are computed based on the bounding boxes of the squares prior to their rotation.

For the left-hand group:

<a:xfrm>
  <a:off x="762000" y="1828800" /> 
  <a:ext cx="3327400" cy="1219200" /> 
  <a:chOff x="762000" y="1828800" /> 
  <a:chExt cx="3327400" cy="1219200" /> 
</a:xfrm>

For the right-hand group:

<a:xfrm>
  <a:off x="4978400" y="1828800" /> 
  <a:ext cx="3327400" cy="1219200" /> 
  <a:chOff x="4978400" y="1828800" /> 
  <a:chExt cx="3327400" cy="1219200" /> 
</a:xfrm>

The remainder of the examples in this subsection illustrate translation and scaling of a group.

In this situation, two shapes are grouped: an arrow and a triangle. No further translation, scaling, rotation, or flipping is applied.

To represent this situation, the child bounding box is the bounding box around both of these shapes; and because no further transformation is applied, the group bounding box is equal to the child bounding box.

The following is an XML snippet representing the transform variables of the group.

<p:grpSpPr>
  <a:xfrm>
    <a:off x="2209800" y="2514600"/>
    <a:ext cx="4038600" cy="2286000"/>
    <a:chOff x="2209800" y="2514600"/>
    <a:chExt cx="4038600" cy="2286000"/>
  </a:xfrm>
</p:grpSpPr>

This example illustrates that no additional parameters are needed to represent the translation of a group. A group is moved to the right. The following diagram shows the starting state, prior to the translation. Note that offset==ChOffset and extent==ChExtent.

Increasing the x component of the offset moves the group to the right.

Similarly, scaling can be performed by adjusting the group bounding box.