Table of Contents

Class PortRenderContext

Namespace
FlowGraph.Avalonia.Rendering.PortRenderers
Assembly
FlowGraph.Avalonia.dll

Context information passed to port renderers.

TRANSFORM-BASED RENDERING:

Scale is always 1.0 - create visuals at logical size. The MatrixTransform on MainCanvas handles zoom. This enables O(1) zoom.

public class PortRenderContext
Inheritance
PortRenderContext
Inherited Members

Properties

Index

Index of this port among its siblings.

public required int Index { get; init; }

Property Value

int

InverseScale

Inverse scale for constant-size elements (1/ViewportZoom). Apply as ScaleTransform to elements that should stay same screen size.

public double InverseScale { get; }

Property Value

double

IsOutput

Whether this is an output port (true) or input port (false).

public required bool IsOutput { get; init; }

Property Value

bool

Scale

Logical scale for visual sizing. Always 1.0 in transform-based rendering.

public required double Scale { get; init; }

Property Value

double

Settings

Canvas settings.

public required FlowCanvasSettings Settings { get; init; }

Property Value

FlowCanvasSettings

Theme

Theme resources for styling.

public required ThemeResources Theme { get; init; }

Property Value

ThemeResources

TotalPorts

Total number of sibling ports.

public required int TotalPorts { get; init; }

Property Value

int

ViewportZoom

Actual viewport zoom level. Use for calculations, not visual sizing.

public double ViewportZoom { get; init; }

Property Value

double