Class ShapeRenderContext
- Namespace
- FlowGraph.Avalonia.Rendering.ShapeRenderers
- Assembly
- FlowGraph.Avalonia.dll
Context object passed to shape renderers with information needed for rendering.
public class ShapeRenderContext
- Inheritance
-
ShapeRenderContext
- Inherited Members
Constructors
ShapeRenderContext(FlowCanvasSettings, double)
Creates a new shape render context.
public ShapeRenderContext(FlowCanvasSettings settings, double scale)
Parameters
settingsFlowCanvasSettingsCanvas settings for sizing and styling.
scaledoubleCurrent zoom scale.
Properties
Scale
Gets the current zoom scale factor.
public double Scale { get; }
Property Value
Settings
Gets the canvas settings.
public FlowCanvasSettings Settings { get; }
Property Value
Methods
CreateBrush(string?)
Creates a brush from a color string. Returns null for null/empty strings.
public static IBrush? CreateBrush(string? colorString)
Parameters
colorStringstringThe color string to convert.
Returns
- IBrush
A SolidColorBrush or null.
ParseColor(string?)
Parses a color string to an Avalonia Color. Supports hex (#RRGGBB, #AARRGGBB), named colors, or returns transparent for null/invalid.
public static Color ParseColor(string? colorString)
Parameters
colorStringstringThe color string to parse.
Returns
- Color
The parsed color or Transparent if parsing fails.
ParseDashStyle(string?)
Parses a dash array string into a DashStyle.
public static DashStyle? ParseDashStyle(string? dashArray)
Parameters
dashArraystringComma-separated dash pattern, e.g., "5,3" or "10,5,2,5".
Returns
- DashStyle
A DashStyle or null for solid lines.