Xui.Core.Canvas.SVG

Assembly: Xui.Core · C# declarations · Assembly overview

Types

enum ArcFlag

Specifies the size of the arc to be drawn when interpreting an SVG arc command. Used in conjunction with the sweep flag to determine the final arc segment. This corresponds to the "large-arc-flag" in the SVG path specification.

public enum ArcFlag
{
    Small = 0,
    Large = 1
}

ArcFlag.Large

Large = 1

Draw the larger of the two possible arc sweeps (greater than 180 degrees).

ArcFlag.Small

Small = 0

Draw the smaller of the two possible arc sweeps (less than or equal to 180 degrees).

class Extensions

Provides SVG-related extension methods for the Xui.Core.Canvas.IPathDrawingContext interface.

public static class Extensions
{
    public static PathDataBuilder PathData(this IPathDrawingContext @this);
}

PathDataBuilder Extensions.PathData(IPathDrawingContext @this)

public static PathDataBuilder PathData(this IPathDrawingContext @this);

Creates a Xui.Core.Canvas.SVG.PathDataBuilder for the given path drawing context. This enables fluent parsing or construction of SVG path commands targeting the current canvas context.

  • this — The path drawing context (e.g., a canvas or drawing surface).

Returns: A Xui.Core.Canvas.SVG.PathDataBuilder instance for building or parsing SVG paths.

ref struct PathDataBuilder

A utility for converting parsed SVG path commands into drawing operations on an Xui.Core.Canvas.IPathDrawingContext target. This builder supports both absolute (e.g., M, L, C) and relative (e.g., m, l, c) SVG commands, and tracks the current drawing point and control points for smooth curves.

public ref struct PathDataBuilder
{
    public readonly IPathDrawingContext Sink;
    public Point? StartPoint;
    public Point CurrentPoint;
    public Point NextCubicControlPoint;
    public Point NextQuadraticControlPoint;
    public PathDataBuilder(IPathDrawingContext sink);
    public PathDataBuilder Begin();
    public PathDataBuilder M(Point point);
    public PathDataBuilder m(Vector vector);
    public PathDataBuilder L(Point point);
    public PathDataBuilder l(Vector vector);
    public PathDataBuilder H(nfloat h);
    public PathDataBuilder h(nfloat h);
    public PathDataBuilder V(nfloat v);
    public PathDataBuilder v(nfloat v);
    public PathDataBuilder C(Point cp1, Point cp2, Point to);
    public PathDataBuilder c(Vector cv1, Vector cv2, Vector to);
    public PathDataBuilder S(Point cp, Point to);
    public PathDataBuilder s(Vector cv, Vector to);
    public PathDataBuilder Q(Point cp, Point to);
    public PathDataBuilder q(Vector cv, Vector to);
    public PathDataBuilder T(Point to);
    public PathDataBuilder t(Vector to);
    public PathDataBuilder A(Vector sr, nfloat xAxisRotationDeg, ArcFlag largeArcFlag, Winding sweepDirection, Point p2);
    public PathDataBuilder a(Vector v2, nfloat xAxisRotationDeg, ArcFlag largeArcFlag, Winding sweepDirection, Vector sr);
    public PathDataBuilder Z();
    public PathDataBuilder z();
}

PathDataBuilder.PathDataBuilder(IPathDrawingContext sink)

public PathDataBuilder(IPathDrawingContext sink);

Initializes a new Xui.Core.Canvas.SVG.PathDataBuilder targeting the specified drawing context.

  • sink — The drawing context that will receive the path instructions.

PathDataBuilder PathDataBuilder.A(Vector sr, NFloat xAxisRotationDeg, ArcFlag largeArcFlag, Winding sweepDirection, Point p2)

public PathDataBuilder A(Vector sr, nfloat xAxisRotationDeg, ArcFlag largeArcFlag, Winding sweepDirection, Point p2);

PathDataBuilder PathDataBuilder.Begin()

public PathDataBuilder Begin();

Begins a new path on the drawing context.

PathDataBuilder PathDataBuilder.C(Point cp1, Point cp2, Point to)

public PathDataBuilder C(Point cp1, Point cp2, Point to);

Point PathDataBuilder.CurrentPoint

public Point CurrentPoint;

The current position of the pen after the last command.

PathDataBuilder PathDataBuilder.H(NFloat h)

public PathDataBuilder H(nfloat h);

PathDataBuilder PathDataBuilder.L(Point point)

public PathDataBuilder L(Point point);

PathDataBuilder PathDataBuilder.M(Point point)

public PathDataBuilder M(Point point);

Point PathDataBuilder.NextCubicControlPoint

public Point NextCubicControlPoint;

The reflected control point for the next cubic Bézier curve (used in S, s).

Point PathDataBuilder.NextQuadraticControlPoint

public Point NextQuadraticControlPoint;

The reflected control point for the next quadratic Bézier curve (used in T, t).

PathDataBuilder PathDataBuilder.Q(Point cp, Point to)

public PathDataBuilder Q(Point cp, Point to);

PathDataBuilder PathDataBuilder.S(Point cp, Point to)

public PathDataBuilder S(Point cp, Point to);

IPathDrawingContext PathDataBuilder.Sink

public readonly IPathDrawingContext Sink;

The target drawing context that receives path commands.

Point? PathDataBuilder.StartPoint

public Point? StartPoint;

The starting point of the current subpath (used for Z command).

PathDataBuilder PathDataBuilder.T(Point to)

public PathDataBuilder T(Point to);

PathDataBuilder PathDataBuilder.V(NFloat v)

public PathDataBuilder V(nfloat v);

PathDataBuilder PathDataBuilder.Z()

public PathDataBuilder Z();

PathDataBuilder PathDataBuilder.a(Vector v2, NFloat xAxisRotationDeg, ArcFlag largeArcFlag, Winding sweepDirection, Vector sr)

public PathDataBuilder a(Vector v2, nfloat xAxisRotationDeg, ArcFlag largeArcFlag, Winding sweepDirection, Vector sr);

PathDataBuilder PathDataBuilder.c(Vector cv1, Vector cv2, Vector to)

public PathDataBuilder c(Vector cv1, Vector cv2, Vector to);

PathDataBuilder PathDataBuilder.h(NFloat h)

public PathDataBuilder h(nfloat h);

PathDataBuilder PathDataBuilder.l(Vector vector)

public PathDataBuilder l(Vector vector);

PathDataBuilder PathDataBuilder.m(Vector vector)

public PathDataBuilder m(Vector vector);

PathDataBuilder PathDataBuilder.q(Vector cv, Vector to)

public PathDataBuilder q(Vector cv, Vector to);

PathDataBuilder PathDataBuilder.s(Vector cv, Vector to)

public PathDataBuilder s(Vector cv, Vector to);

PathDataBuilder PathDataBuilder.t(Vector to)

public PathDataBuilder t(Vector to);

PathDataBuilder PathDataBuilder.v(NFloat v)

public PathDataBuilder v(nfloat v);

PathDataBuilder PathDataBuilder.z()

public PathDataBuilder z();