SvgGroup.cs 1.82 KB
Newer Older
davescriven's avatar
davescriven committed
1
2
3
4
using System;
using System.Collections.Generic;
using System.Xml;
using System.Text;
5
using System.Drawing;
davescriven's avatar
davescriven committed
6
7
8

namespace Svg
{
9
10
11
    /// <summary>
    /// An element used to group SVG shapes.
    /// </summary>
12
    [SvgElement("g")]
13
    public class SvgGroup : SvgVisualElement
davescriven's avatar
davescriven committed
14
15
16
17
18
    {
        public SvgGroup()
        {
        }

19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
        /// <summary>
        /// Gets or sets the fill.
        /// </summary>
        /// <value>The fill.</value>
        [SvgAttribute("fill")]
        public override SvgPaintServer Fill
        {
            get { return (this.Attributes["Fill"] == null) ? new SvgColourServer(Color.Transparent) : (SvgPaintServer)this.Attributes["Fill"]; }
            set { this.Attributes["Fill"] = value; }
        }

        /// <summary>
        /// Gets the <see cref="GraphicsPath"/> for this element.
        /// </summary>
        /// <value></value>
davescriven's avatar
davescriven committed
34
35
36
37
38
        public override System.Drawing.Drawing2D.GraphicsPath Path
        {
            get { return null; }
        }

39
40
41
42
        /// <summary>
        /// Gets the bounds of the element.
        /// </summary>
        /// <value>The bounds.</value>
davescriven's avatar
davescriven committed
43
44
45
46
47
        public override System.Drawing.RectangleF Bounds
        {
            get { return new System.Drawing.RectangleF(); }
        }

48
49
50
51
        /// <summary>
        /// Renders the <see cref="SvgElement"/> and contents to the specified <see cref="Graphics"/> object.
        /// </summary>
        /// <param name="graphics">The <see cref="Graphics"/> object to render to.</param>
52
        protected override void Render(SvgRenderer renderer)
davescriven's avatar
davescriven committed
53
        {
54
            this.PushTransforms(renderer);
55
            this.SetClip(renderer);
56
            base.RenderChildren(renderer);
57
            this.ResetClip(renderer);
58
            this.PopTransforms(renderer);
davescriven's avatar
davescriven committed
59
60
61
        }
    }
}