Boxed geometry and drawable placement
Sizing, registration and offsets for rectangles, circles and ellipses.
Ratified 2026-12-03. A drawable places the whole object. A rectangle, circle or ellipse defines its contour within that object's local coordinates. This chapter defines the Level 1 source contract. N4 and the standalone preview evaluate these properties before constructing the contour. Conformance cases · Transform review · Geometry position review
Size, registration and offset
| Geometry owner | Required size | Box dimensions (W, H) | Default (anchor-u, anchor-v) |
|---|---|---|---|
rect | width, height | (width, height) | (0.5, 0.5), center |
circle | r | (2r, 2r) | (0.5, 0.5), center |
ellipse | rx, ry | (2rx, 2ry) | (0.5, 0.5), center |
Each omitted registration axis resolves to 0.5, independently, at Base and whenever that axis samples its default. With both offsets omitted, an unadorned primitive is centered at drawable-local (0, 0). The four optional properties belong to the geometry element. Ratification and one-property edits
anchor-uandanchor-vare finite signed fractions of the unpainted width and height. Zero selects the left or top edge, one the right or bottom edge. Values outside that interval extrapolate. Use1.25to place the registration point a quarter-width beyond the right edge.offset-xandoffset-ygive the coordinates of that registration point in drawable-local units. Both default to zero. Keying an offset slides the contour through the local frame. The size and corner radii remain independently editable.
At Base or at the requested local time, resolve each property's own base or track first. The sampled fractions (u,v) and offsets (gx,gy) determine the local box.
left = gx − u × W right = left + W
top = gy − v × H bottom = top + H
center = (left + W/2, top + H/2)Construct the rectangle and its rounded corners inside this box. A circle or ellipse uses this center and its authored radii. Sizes and radii are nonnegative finite lengths. When W is zero both horizontal bounds equal gx, even if u is negative or animated. The same rule applies to H and gy. A collapsed primitive can still locate an attached child. Reflection acts later through drawable scale. Geometry and corners · Degenerate hosts
Each of the four properties is independently keyable using scalar interpolation on its owner. Preserve the time unit of each key. If both width and registration animate, multiply their sampled values at the requested instant. Interpolating only the resulting endpoint corners can change the intervening motion. Animation
What follows an edit
For a root shape translated to (100, 60) containing <rect width="80" height="20"/>, the unrotated rectangle spans x = 60…140 and y = 50…70. Changing only the shape’s rotate to 90 keeps the center at (100, 60) and gives extents x = 90…110 and y = 20…100. Starting from the unrotated shape, changing only width to 120 gives extents x = 40…160 and y = 50…70. Both edits use the same local pivot (0, 0). Executable rectangle case
A sign using the default pivot can turn about a bolt at its left midpoint.
<shape translate-x="240" translate-y="120" rotate="-24">
<rect width="80" height="26" anchor-u="0"/>
<fill><paint><solid color="#F1E9CBFF"/></paint></fill>
<shape u="1" v="0.5">
<circle r="3"/>
<fill><paint><solid color="#F77943FF"/></paint></fill>
</shape>
</shape>Changing only width="80" to width="160" keeps the bolt at (240,120). The lamp follows the sampled right edge along the tilted axis and keeps its radius. Omitting anchor-u registers the sign's center at the bolt. For an outboard bolt, anchor-u="1.25" and zero offset leave a gap of 20 at width 80 and 40 at width 160. To keep a constant 20-unit gap at both widths, write anchor-u="1" offset-x="-20".
- A child with a bounds or contour locator reads the resulting geometry. An unlocated child's frame stays at the owner's local origin. A local user-space gradient retains its authored coordinates as the contour moves across it. An image paint fitted to the geometry uses the resulting box. Masks and boolean operands keep their existing ownership and placement rules. Attachments · Paint
- A drawable's
translate-x/ymoves its assembled artwork in the parent or attachment frame. Itspivot-x/yis an absolute local point, default (0,0), for scale, shear and rotation. Changing a dimension never rewrites that pivot. A live hinge tracking a changing geometric center requires authored motion when the registration point lies elsewhere. Local-to-parent transform - The geometry child retains its paint-order slot. A shape's transform and appearance still belong to that shape after a geometry replacement. Text retains its baseline and text anchor. Paths retain their authored points. Groups and sequence placements have their own transforms. None acquires a box registration.
- Artwork on a spatial plane resolves locally before the plane pose and camera projection. An ordinary 2D shape needs no camera or plane fields. The plane's existing visibility and projection rules apply. Spatial trial
Names and interchange
Use the four registration and offset names only on rect, circle and ellipse. Apply the ordinary wrong-owner, invalid-scalar and track diagnostics. Under this contract a strict reader diagnoses unqualified x/y on a rectangle and cx/cy on a circle or ellipse, including tracks targeting them. The same spellings keep their defined meanings on text and gradients. Namespaced host attributes remain opaque. Source and names
To preserve a resolved SVG rectangle’s x/y and its response to a width or height edit, write anchor-u="0" anchor-v="0" and map x/y to the corresponding local offsets. A circle or ellipse maps its SVG center directly to those offsets with default registration. Export the sampled left/top for a rectangle or the sampled center for a circle or ellipse. SVG crosswalk
For an internal corpus rewrite, rename each former coordinate and its directly owned track target on the corresponding primitive. Preserve the base even when it differs from the first key, as well as easing, timing and unrelated source bytes. Detect a collision with existing unqualified host metadata before assigning a new core name. Migration tooling performs this rewrite.
Design basis
Rive's parametric origin makes a change of width grow a bar about a chosen point. After Effects gives a parametric path its own position and size inside a separately transformable group. These edits distinguish a proportional mounting distance, a fixed contour displacement and a whole-object Move, even when all three give the same still. The existing NCF doctrine of local property ownership covers each operation. Rive shape origins · After Effects shape paths and transforms · NCF doctrine