Registration
Choose which point of a rectangle, circle, or ellipse sits at the local offset.
Anchor fractions select a point relative to the unpainted geometry bounds. The two offset attributes give that point’s drawable-local coordinates.
Example
Pin a rectangle by its left midpoint
Registration belongs to <rect>, <circle>, and <ellipse>. Write anchor-u="0" on the rectangle to select its left edge. The omitted anchor-v still selects halfway down. The shape places that left midpoint at (56, 24), and the white rectangle extends from x = 56 to 66 and y = 21 to 27. Set anchor-v="0" as well to place the top-left corner at the shape origin. Use offset-x or offset-y on the geometry when the selected point needs to sit away from the origin.
<shape translate-x="56" translate-y="24">
<rect width="10" height="6" anchor-u="0"/>
<fill><paint><solid color="#FFFFFFFF"/></paint></fill>
</shape>Usage context
Trait Registration in the scene format type model.
Related pages in this reference are <rect>, <circle>, <ellipse>.
Attributes
anchor-u
Value fraction of width · If omitted 0.5 · Keys Scalar
Horizontal registration. Zero selects the left edge and one the right edge. Values outside that interval extrapolate.
anchor-v
Value fraction of height · If omitted 0.5 · Keys Scalar
Vertical registration. Zero selects the top edge and one the bottom edge. Values outside that interval extrapolate.
offset-x
Value local units · If omitted 0 · Keys Scalar
Horizontal coordinate of the registered point.
offset-y
Value local units · If omitted 0 · Keys Scalar
Vertical coordinate of the registered point.