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
bb69f2be
Commit
bb69f2be
authored
8 years ago
by
Tebjan Halm
Committed by
GitHub
8 years ago
Browse files
Options
Download
Plain Diff
Merge pull request #297 from LightningDragon/master
Found better solution to SvgClosePathSegment tested with Tiger.
parents
35d0e857
6a20095e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Source/Paths/SvgClosePathSegment.cs
+12
-14
Source/Paths/SvgClosePathSegment.cs
with
12 additions
and
14 deletions
+12
-14
Source/Paths/SvgClosePathSegment.cs
+
12
-
14
View file @
bb69f2be
...
...
@@ -8,25 +8,23 @@ namespace Svg.Pathing
{
public
override
void
AddToPath
(
System
.
Drawing
.
Drawing2D
.
GraphicsPath
graphicsPath
)
{
if
(
graphicsPath
.
PointCount
==
0
)
{
return
;
}
var
pathData
=
graphicsPath
.
PathData
;
if
(
pathData
.
Points
.
Length
>
0
)
{
// Important for custom line caps. Force the path the close with an explicit line, not just an implicit close of the figure.
var
pathPoints
=
graphicsPath
.
PathPoints
;
if
(!
pathPoints
[
0
].
Equals
(
pathPoints
[
pathPoints
.
Length
-
1
]))
if
(!
path
Data
.
Points
[
0
].
Equals
(
path
Data
.
Points
[
path
Data
.
Points
.
Length
-
1
]))
{
var
pathTypes
=
graphicsPath
.
PathTypes
;
int
i
=
pathPoints
.
Length
-
1
;
while
(
i
>=
0
&&
pathTypes
[
i
]
>
0
)
i
--;
int
i
=
pathData
.
Points
.
Length
-
1
;
while
(
i
>=
0
&&
pathData
.
Types
[
i
]
>
0
)
i
--;
if
(
i
<
0
)
i
=
0
;
graphicsPath
.
AddLine
(
pathPoints
[
pathPoints
.
Length
-
1
],
pathPoints
[
i
]);
graphicsPath
.
AddLine
(
path
Data
.
Points
[
path
Data
.
Points
.
Length
-
1
],
path
Data
.
Points
[
i
]);
}
graphicsPath
.
CloseFigure
();
}
}
public
override
string
ToString
()
{
...
...
This diff is collapsed.
Click to expand it.
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