Table of Contents

Class SvgGroup

Namespace
Egami.Svg
Assembly
Egami.Svg.dll

A group of nodes drawn in order: a g, svg, a, switch, a use instance or a marker.

public sealed record SvgGroup : SvgNode, IEquatable<SvgNode>, IEquatable<SvgGroup>
Inheritance
SvgGroup
Implements
Inherited Members

Examples

// The resolved tree: groups, paths with their paints and strokes, images; styles applied and units in pixels.
static void Walk(SvgNode node, int depth)
{
    string what = node switch
    {
        SvgPath path => $"path {path.Path.Bounds} fill {path.Fill}",
        SvgGroup group => $"group of {group.Children.Count}",
        SvgImage image => $"image {image.Destination}",
        _ => node.GetType().Name,
    };
    Console.WriteLine($"{new string(' ', depth * 2)}{node.Id} {what} opacity {node.Opacity}");
    if (node is SvgGroup g)
    {
        foreach (SvgNode child in g.Children)
        {
            Walk(child, depth + 1);
        }
    }
}

Walk(document.RenderTree, 0);

Properties

Children

Gets the children, in drawing order.

public IReadOnlyList<SvgNode> Children { get; init; }

Property Value

IReadOnlyList<SvgNode>

ClipRect

Gets a rectangle the children are clipped to, in this group's coordinates (a nested svg's viewport), or null.

public RectF? ClipRect { get; init; }

Property Value

RectF?