SvgPathBasedElement.cs 640 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
using System.Drawing.Drawing2D;

namespace Svg
{
    /// <summary>
    /// Represents an element that is using a GraphicsPath as rendering base.
    /// </summary>
    public abstract class SvgPathBasedElement : SvgVisualElement
    {
        public override System.Drawing.RectangleF Bounds
        {
            get
            {
                var path = this.Path(null);
                if (Transforms != null)
                {
                    path = (GraphicsPath)path.Clone();
                    path.Transform(Transforms.GetMatrix());
                }
                return path.GetBounds();
            }
        }
    }
}