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
69a4de64
Unverified
Commit
69a4de64
authored
Jan 27, 2019
by
mrbean-bremen
Browse files
Correctly show mid markers for paths with Bezier curves
- fixes W3C example painting-marker-04-f.svg
parent
2a8ea670
Changes
3
Hide whitespace changes
Inline
Side-by-side
Source/Basic Shapes/SvgMarkerElement.cs
View file @
69a4de64
...
...
@@ -67,8 +67,18 @@ namespace Svg
if
(
this
.
MarkerMid
!=
null
)
{
SvgMarker
marker
=
this
.
OwnerDocument
.
GetElementById
<
SvgMarker
>(
this
.
MarkerMid
.
ToString
());
int
bezierIndex
=
-
1
;
for
(
int
i
=
1
;
i
<=
path
.
PathPoints
.
Length
-
2
;
i
++)
marker
.
RenderMarker
(
renderer
,
this
,
path
.
PathPoints
[
i
],
path
.
PathPoints
[
i
-
1
],
path
.
PathPoints
[
i
],
path
.
PathPoints
[
i
+
1
]);
{
// for Bezier curves, the marker shall only been shown at the last point
if
((
path
.
PathTypes
[
i
]
&
7
)
==
3
)
bezierIndex
=
(
bezierIndex
+
1
)
%
3
;
else
bezierIndex
=
-
1
;
if
(
bezierIndex
==
-
1
||
bezierIndex
==
2
)
marker
.
RenderMarker
(
renderer
,
this
,
path
.
PathPoints
[
i
],
path
.
PathPoints
[
i
-
1
],
path
.
PathPoints
[
i
],
path
.
PathPoints
[
i
+
1
]);
}
}
if
(
this
.
MarkerEnd
!=
null
)
...
...
Tests/Svg.UnitTests/PassingTests.csv
View file @
69a4de64
...
...
@@ -48,6 +48,7 @@ painting-fill-02-t
painting-fill-03-t
painting-fill-05-b
painting-marker-01-f
painting-marker-04-f
painting-marker-06-f
painting-stroke-01-t
painting-stroke-02-t
...
...
Tests/W3CTestSuite/PassingTests.txt
View file @
69a4de64
...
...
@@ -54,6 +54,7 @@ painting-fill-03-t.svg
painting-fill-04-t.svg
painting-fill-05-b.svg
painting-marker-01-f.svg
painting-marker-04-f.svg
painting-marker-06-f.svg
painting-stroke-01-t.svg
painting-stroke-02-t.svg
...
...
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