public readonly record struct TextDecorationAn element's resolved text-decoration, ready to draw.
Remarks
Resolved except for the two autos, which only a run can settle. A thickness and an underline position are the face's to state — see DecorationMetrics — and a line may be composed of runs in more than one face, so the value that reaches here is either a length the author wrote or NaN meaning "ask the font". NaN rather than zero, for TextRun.Leading's reason: zero is a thickness somebody might mean.
⚠ Color is nullable and null means currentColor. CSS's initial value for text-decoration-color is currentColor, and resolving it to the text colour here rather than at the point of drawing would mean an element that sets only text-decoration-line carries a colour it never asked for — which the animator would then happily interpolate away from.
Fields and properties (6)
public TextDecorationLine LinesWhich lines to draw.
public TextDecorationStyle StyleWhether each is one bar or two.
public Color4? ColorWhat colour, or null for the text's own.
public float ThicknessHow thick, in pixels, or NaN for the face's.
public float OffsetHow much further down the underline sits, in pixels. Zero for auto.
public bool IsNoneNothing to draw. The overwhelmingly common case, and the one that must cost nothing.
Methods (1)
public TextDecoration(TextDecorationLine Lines, TextDecorationStyle Style = Solid, Color4? Color = null, float Thickness = NaN, float Offset = 0)An element's resolved text-decoration, ready to draw.
Used by (2)
- DrawListBuilderVixen.Ui
- TextRunVixen.Ui