Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ImportedProjects
SVG
Commits
c251882d
Commit
c251882d
authored
Nov 29, 2013
by
Tebjan Halm
Browse files
Merge pull request #37 from FurryFuttock/master
Fixed stack overflow due to recursion.
parents
2bba3e4e
47382ffe
Changes
1
Hide whitespace changes
Inline
Side-by-side
Source/Basic Shapes/SvgPolyline.cs
View file @
c251882d
...
...
@@ -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
;
}
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment