What stays fixed when I rotate or resize?
Rotate a drawable or change its dimensions around a chosen point.
Set rotate on the shape to turn its picture about the drawable’s pivot. Set width on the rectangle to change its local geometry about the registration point. Both points start at the shape’s local origin in the sampled rectangle scene.
Keep the center fixed
The first shape’s translation places its local origin at (32, 24). Its rectangle uses the default center registration. The shape owns the rotation track and the rectangle owns a separate width track.
| Frame | Shape rotation | Local rectangle size | Painted footprint in scene coordinates |
|---|---|---|---|
| 0 | 0° | 12 × 8 | 12 × 8 |
| 4 | 90° clockwise | 12 × 8 | 8 × 12 |
| 8 | 90° clockwise | 20 × 8 | 8 × 20 |
The footprint stays centered at (32, 24). At frame 8 the 20-unit local X dimension appears vertical because the shape’s rotation applies after computing its local geometry.
Keep the left edge mounted
Set anchor-u="0" on the first rectangle and leave anchor-v at its default of 0.5. Its local left-edge midpoint now sits at the shape pivot, (32, 24) in the scene. At frame 8 the rotated rectangle extends downward from y = 24 to 44.
Set a geometry offset to move the registration point within the drawable. Set a drawable pivot to move the rotation point. Use a group to transform several drawables together, or a locator to keep a child mounted on the geometry. Registration and offset · Local-to-parent transforms
Examples
The shape owns the rotation. The rectangle owns its local width. The shape’s translation and the rectangle’s default center registration keep the painted rectangle centered at (32, 24).
Download the complete .nothing source · Source on GitHub
Rendered with ncf-preview at 80 × 56.



<shape translate-x="32" translate-y="24">
<animate attributeName="rotate" fill="freeze">
<key frame="0" value="0" ease="linear"/>
<key frame="4" value="90"/>
</animate>
<rect width="12" height="8">
<animate attributeName="width" fill="freeze">
<key frame="4" value="12" ease="linear"/>
<key frame="8" value="20"/>
</animate>
</rect>
<fill><paint><solid color="#FFFFFFFF"/></paint></fill>
</shape>