ProtectedbuildOne text element per element when any of them is a super- or subscript, laid out by hand; otherwise one text element with a tspan each, the way text does it.
The hand-laid branch exists because a tspan cannot be lifted off the baseline on its own here — the positions are computed from each element's own font size.
Optionalbounds?: {OptionalcreationTime?: numberOptionaldecorators?: (Optionalelements?: (Optionalid?: stringOptionalmodificationDate?: numberOptionalpoint?: { x?: number; y?: number }Optionalstyle?: {Optionaltransform?: { tx?: number; ty?: number; xx?: number; xy?: number; yx?: number; yy?: number }Where this symbol sits, relative to the coordinates it stores.
A transform writes here and nowhere else: the raw coordinates are what the symbol was created with and never move again. That is what lets the renderer apply a change by rewriting one attribute instead of rebuilding the element, and what keeps undo exact — re-applying an inverse matrix restores the value bit for bit, where re-transforming coordinates accumulated rounding.
Optionaltx?: numberOptionalty?: numberOptionalxx?: numberOptionalxy?: numberOptionalyx?: numberOptionalyy?: numberOptionaltype?: MathStaticcreateOptionalbounds?: {OptionalcreationTime?: numberOptionaldecorators?: (Optionalelements?: (Optionalid?: stringOptionalmodificationDate?: numberOptionalpoint?: { x?: number; y?: number }Optionalstyle?: {Optionaltransform?: { tx?: number; ty?: number; xx?: number; xy?: number; yx?: number; yy?: number }Where this symbol sits, relative to the coordinates it stores.
A transform writes here and nowhere else: the raw coordinates are what the symbol was created with and never move again. That is what lets the renderer apply a change by rewriting one attribute instead of rebuilding the element, and what keeps undo exact — re-applying an inverse matrix restores the value bit for bit, where re-transforming coordinates accumulated rounding.
Optionaltx?: numberOptionalty?: numberOptionalxx?: numberOptionalxy?: numberOptionalyx?: numberOptionalyy?: numberOptionaltype?: MathStaticcreateOptionalstyle: {StaticgetThe box the symbol was measured at, as a shape.
An outline rather than a filled one, and that is the behaviour it had: typesetOverlapsBox asked
"a corner inside the query, or a side crossing one of its sides", both about the boundary. A
query landing wholly inside a word therefore did not select it, and still does not.
symbol.bounds is the raw box, always measured unrotated and unscaled — turning and scaling are
the matrix's job — so its corners are the shape, and a frame angle would have nothing to carry.
ProtectedgetA rendered word carries what a path does not: style: noSelection, so a drag over it moves the
symbol instead of selecting its letters as text, and its opacity — which for a path symbol goes
on the path, and here has no path to go on.
StaticgetHandles for dragging one vertex of this symbol. Empty by default: most symbols resize by their bounding box alone, and only the edge kinds offer per-vertex handles today.
The group, the glyphs, then the decorators — highlights underneath, everything else on top.
That layering is why decorators are appended here rather than by each subclass: a highlight drawn after the text would paint over it, and the two utils had the same ten lines to avoid it.
StaticisWhether every element of the math block is bold. An empty block is not.
Always. A typeset symbol is drawn from glyphs at a font size, and a font size is one number — scaling the axes unequally would ask for glyphs that do not exist.
Protectedmappoints, carried through symbol.transform the same way a transform manager moves the symbol
itself — used by getSnapPoints/getResizePoints overrides, which compute in the symbol's raw
frame and hand the result through this once, forward, rather than every symbol type mapping its
own points individually.
Forward, and exact: a point maps to a point however the matrix turns or scales, so points are
already the symbol's own geometry, and mapping a point through a matrix is always exact, however
that matrix turns or scales.
Whether a query box touches this symbol — the question selection and erasing both ask.
Answered by the shape getGeometry returns, so a type describes what it is once and inherits this. Every built-in used to write the same one line here. Override it only for a type whose hit test is not a question about its outline.
ProtectedrawScales this symbol. Composes through applyTransform, for the same reason translate does.
Turns this symbol. Composes through applyTransform, for the same reason translate does.
StatictoOptionalbounds?: {OptionalcreationTime?: numberOptionaldecorators?: (Optionalelements?: (Optionalid?: stringOptionalmodificationDate?: numberOptionalpoint?: { x?: number; y?: number }Optionalstyle?: {Optionaltransform?: { tx?: number; ty?: number; xx?: number; xy?: number; yx?: number; yy?: number }Where this symbol sits, relative to the coordinates it stores.
A transform writes here and nowhere else: the raw coordinates are what the symbol was created with and never move again. That is what lets the renderer apply a change by rewriting one attribute instead of rebuilding the element, and what keeps undo exact — re-applying an inverse matrix restores the value bit for bit, where re-transforming coordinates accumulated rounding.
Optionaltx?: numberOptionalty?: numberOptionalxx?: numberOptionalxy?: numberOptionalyx?: numberOptionalyy?: numberOptionaltype?: MathMoves this symbol by a matrix.
Concrete rather than abstract: every built-in type composes the matrix the same way, through applyTransform, and none of the six overrides this. A custom util only needs its own body if it stores something a matrix cannot express.
StaticupdateStaticupdate
Moves, turns or scales this symbol by composing the matrix onto the one it already carries.
One implementation for every type, where there used to be one per type per operation. A symbol's coordinates are not touched: the matrix is the whole of what a transform changes, so there is no per-type geometry to update and nothing derived left to refresh.
Override only for a type whose transform is not affine —
DecoratorUtiloverrides it to a no-op because a decorator follows its targets rather than moving on its own.