Commit 23143bb7 authored by Tebjan Halm's avatar Tebjan Halm
Browse files

* fixed getPath bug

* added implicit operator from RectangleF to SvgViewBox
parent fafb1444
...@@ -60,6 +60,16 @@ namespace Svg ...@@ -60,6 +60,16 @@ namespace Svg
{ {
return new RectangleF(value.MinX, value.MinY, value.Width, value.Height); return new RectangleF(value.MinX, value.MinY, value.Width, value.Height);
} }
/// <summary>
/// Performs an implicit conversion from <see cref="System.Drawing.RectangleF"/> to <see cref="Svg.SvgViewBox"/>.
/// </summary>
/// <param name="value">The value.</param>
/// <returns>The result of the conversion.</returns>
public static implicit operator SvgViewBox(RectangleF value)
{
return new SvgViewBox(value.X, value.Y, value.Width, value.Height);
}
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="SvgViewBox"/> struct. /// Initializes a new instance of the <see cref="SvgViewBox"/> struct.
......
...@@ -413,25 +413,23 @@ namespace Svg ...@@ -413,25 +413,23 @@ namespace Svg
/// <param name="path"></param> /// <param name="path"></param>
protected void AddPaths(SvgElement elem, GraphicsPath path) protected void AddPaths(SvgElement elem, GraphicsPath path)
{ {
foreach(var c in elem.Children) foreach(var child in elem.Children)
{ {
if (c is SvgVisualElement) if (!(child is SvgGroup) && child is SvgVisualElement)
{ {
var cp = ((SvgVisualElement)c).Path; var childPath = ((SvgVisualElement)child).Path;
if (childPath != null)
if (cp != null)
{ {
cp = (GraphicsPath)cp.Clone(); childPath = (GraphicsPath)childPath.Clone();
if(c.Transforms != null) if(child.Transforms != null)
cp.Transform(c.Transforms.GetMatrix()); childPath.Transform(child.Transforms.GetMatrix());
path.AddPath(cp, false); path.AddPath(childPath, false);
} }
} }
AddPaths(c, path); AddPaths(child, path);
} }
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment