Commit c251882d authored by Tebjan Halm's avatar Tebjan Halm
Browse files

Merge pull request #37 from FurryFuttock/master

Fixed stack overflow due to recursion.
parents 2bba3e4e 47382ffe
......@@ -13,13 +13,14 @@ namespace Svg
[SvgElement("polyline")]
public class SvgPolyline : SvgPolygon
{
private GraphicsPath _Path;
public override GraphicsPath Path
{
get
{
if (Path == null || this.IsPathDirty)
if (_Path == null || this.IsPathDirty)
{
Path = new GraphicsPath();
_Path = new GraphicsPath();
try
{
......@@ -28,13 +29,13 @@ namespace Svg
PointF endPoint = new PointF(Points[i].ToDeviceValue(this), Points[i + 1].ToDeviceValue(this));
// TODO: Remove unrequired first line
if (Path.PointCount == 0)
if (_Path.PointCount == 0)
{
Path.AddLine(endPoint, endPoint);
_Path.AddLine(endPoint, endPoint);
}
else
{
Path.AddLine(Path.GetLastPoint(), endPoint);
_Path.AddLine(_Path.GetLastPoint(), endPoint);
}
}
}
......@@ -44,7 +45,7 @@ namespace Svg
}
this.IsPathDirty = false;
}
return Path;
return _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