@invana/canvas-core 0.0.14 → 0.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1833,6 +1833,21 @@ type CompositePart = ({
1833
1833
  readonly text: string;
1834
1834
  /** Horizontal anchor of the text block at `(x, y)`. Default `'left'`. */
1835
1835
  readonly anchor?: 'left' | 'center' | 'right';
1836
+ /**
1837
+ * Vertical anchor of the text block at `(x, y)` — the partner of
1838
+ * {@link anchor}, measured against the **rendered line box** rather than
1839
+ * `fontSize` (a line box is ascent + descent + line gap, typically
1840
+ * 1.2–1.4 × `fontSize`).
1841
+ *
1842
+ * Default `'top'`, which places `y` at the top of the block — the
1843
+ * historical behaviour, so an existing label never moves.
1844
+ *
1845
+ * Use `'middle'` to centre text in a box (a pill, a table row, an avatar
1846
+ * disc): give `y` the box's centre line and let the renderer do the
1847
+ * measuring. Don't pre-offset `y` by `(boxHeight - fontSize) / 2` — that
1848
+ * underestimates the line box and lands the text low.
1849
+ */
1850
+ readonly vAnchor?: 'top' | 'middle' | 'bottom';
1836
1851
  readonly fontSize?: number;
1837
1852
  readonly fontWeight?: number | string;
1838
1853
  readonly fontStyle?: 'normal' | 'italic';