Vixen
02b45cc4
csharp
public sealed class NodePreviewLayer

The swatches hanging under the nodes that asked for one.

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

Remarks

Drawn rather than built, for NodeMinimap's reason. A preview is one filled rectangle; as an element it would be a style node, a layout box and a rebind for a picture nobody clicks.

⚠ Under the node rather than inside it. A node's height is NodeCanvas.HeightOf, which is its ports and nothing else, and there is no way to make one taller for a preview without teaching the canvas about previews. Hanging the swatch below the box needs nothing from the canvas and does not move a single port anchor — and it is where Unity's shader graph puts one anyway.

⚠ It does not paint over the minimap. The layer is a child of the canvas and is therefore drawn after every part of it, minimap included, so a node that happens to lie under the overview would otherwise put a swatch on top of it.

Fields and properties (4)

  • protected override string TagName

    The element name this type answers to when a caller does not choose one.

  • public NodeGraphView? View

    The view it draws for.

  • public float Size

    How tall a swatch is, in graph units.

  • public float Gap

    How far under the node it hangs, in graph units.

Methods (1)

  • protected override void OnDraw(DrawContext context)

    Draws whatever this element is, beyond what a stylesheet can describe.

Used by (1)

  • NodeGraphViewVixen.Editor.NodeGraph