Vixen
02b45cc4
csharp
public readonly record struct NodeLayoutOptions

How much room an automatic layout leaves.

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

Remarks

⚠ The four size numbers are the view's, restated. A layout that assumed every node was the same height puts a two-port node and a twelve-port one on the same pitch, so the columns either overlap or are mostly air. They are parameters rather than read from a canvas because this runs against a model with no view attached — which is what makes it testable against coordinates rather than against a screenshot — and NodeGraphView passes its own.

Fields and properties (8)

  • public Vector2 Origin

    Where the leftmost column's left edge goes.

  • public float ColumnGap

    How much clear space is left between one column and the next.

  • public float RowGap

    And between one node and the one under it.

  • public float NodeWidth

    How wide a node is taken to be.

  • public float HeaderHeight

    How tall its title bar is.

  • public float PortPitch

    How far apart its ports are.

  • public float Padding

    How much room is left under its last port.

  • public static NodeLayoutOptions Default

    What a view with the stock theme would use.

Methods (2)

  • public NodeLayoutOptions(Vector2 Origin = default(Vector2), float ColumnGap = 80, float RowGap = 24, float NodeWidth = 160, float HeaderHeight = 22, float PortPitch = 18, float Padding = 6)

    How much room an automatic layout leaves.

  • public float HeightOf(int rows)

    How tall a node with a given number of port rows is.

Used by (4)

  • LayoutCommandVixen.Editor.NodeGraph
  • LayoutTestsVixen.Editor.NodeGraph.Tests
  • NodeGraphLayoutVixen.Editor.NodeGraph
  • NodeGraphViewVixen.Editor.NodeGraph