Unverified Commit 69a4de64 authored by mrbean-bremen's avatar mrbean-bremen
Browse files

Correctly show mid markers for paths with Bezier curves

- fixes W3C example painting-marker-04-f.svg
parent 2a8ea670
......@@ -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)
......
......@@ -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
......
......@@ -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
......
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