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
47382ffe
Commit
47382ffe
authored
Nov 28, 2013
by
Furry Futtock
Browse files
Fixed stack overflow due to recursion.
parent
2bba3e4e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Source/Basic Shapes/SvgPolyline.cs
View file @
47382ffe
...
@@ -13,13 +13,14 @@ namespace Svg
...
@@ -13,13 +13,14 @@ namespace Svg
[
SvgElement
(
"polyline"
)]
[
SvgElement
(
"polyline"
)]
public
class
SvgPolyline
:
SvgPolygon
public
class
SvgPolyline
:
SvgPolygon
{
{
private
GraphicsPath
_Path
;
public
override
GraphicsPath
Path
public
override
GraphicsPath
Path
{
{
get
get
{
{
if
(
Path
==
null
||
this
.
IsPathDirty
)
if
(
_
Path
==
null
||
this
.
IsPathDirty
)
{
{
Path
=
new
GraphicsPath
();
_
Path
=
new
GraphicsPath
();
try
try
{
{
...
@@ -28,13 +29,13 @@ namespace Svg
...
@@ -28,13 +29,13 @@ namespace Svg
PointF
endPoint
=
new
PointF
(
Points
[
i
].
ToDeviceValue
(
this
),
Points
[
i
+
1
].
ToDeviceValue
(
this
));
PointF
endPoint
=
new
PointF
(
Points
[
i
].
ToDeviceValue
(
this
),
Points
[
i
+
1
].
ToDeviceValue
(
this
));
// TODO: Remove unrequired first line
// TODO: Remove unrequired first line
if
(
Path
.
PointCount
==
0
)
if
(
_
Path
.
PointCount
==
0
)
{
{
Path
.
AddLine
(
endPoint
,
endPoint
);
_
Path
.
AddLine
(
endPoint
,
endPoint
);
}
}
else
else
{
{
Path
.
AddLine
(
Path
.
GetLastPoint
(),
endPoint
);
_
Path
.
AddLine
(
_
Path
.
GetLastPoint
(),
endPoint
);
}
}
}
}
}
}
...
@@ -44,7 +45,7 @@ namespace Svg
...
@@ -44,7 +45,7 @@ namespace Svg
}
}
this
.
IsPathDirty
=
false
;
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