Vixen
02b45cc4
csharp
public readonly record struct BoxStyle

What a box needs beyond a colour and a size.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

⚠ A side buffer, not more fields on DrawCommand. Eight radius floats, a colour and an axis would half again the size of the struct the frame diff compares every frame — and every text run, every path and every plain rectangle would pay for them. The draw list already keeps variable and rare things beside the commands, for glyphs and for path segments, and this is the same argument with a different shape.

⚠ A zero axis is the sentinel for "no gradient" rather than a flag beside it. A gradient along no direction is not a gradient anybody can mean, so the value is free; a separate bool would be a second thing to keep in step and a state — flag set, axis zero — that has no meaning.

Fields and properties (4)

  • public CornerRadii Corners

    Its corner radii.

  • public Color4 GradientEnd

    The colour at the far end of its gradient.

  • public Vector2 GradientAxis

    Which way the gradient runs, as a direction in the box's own space. A zero axis means the box is filled flat and is not read.

  • public bool HasGradient

    Whether this box is filled with more than one colour.

Methods (3)

Used by (10)

  • ColorFieldVixen.Ui.Controls.Advanced
  • ColorStripVixen.Ui.Controls.Advanced
  • CurveEditorVixen.Ui.Controls.Advanced
  • DrawContextVixen.Ui
  • DrawListVixen.Ui
  • GradientBarVixen.Ui.Controls.Advanced
  • GradientRailVixen.Ui.Controls.Advanced
  • UiGeometryBuilderVixen.Ui
  • UiGeometryTestsVixen.Ui.Tests
  • UiImageTestsVixen.Graphics.Golden.Tests