diff --git a/SvgGdiTest/SvgGdiTestForm.cs b/SvgGdiTest/SvgGdiTestForm.cs index 44b0457..95f7e80 100644 --- a/SvgGdiTest/SvgGdiTestForm.cs +++ b/SvgGdiTest/SvgGdiTestForm.cs @@ -502,6 +502,12 @@ private void Render(IGraphics ig) LinearGradientBrush gbr2 = new LinearGradientBrush(new Point(0, 0), new Point(10, 20), Color.WhiteSmoke, Color.CornflowerBlue); gbr2.WrapMode = WrapMode.TileFlipXY; ig.FillPath(gbr2, myPath); + + GraphicsPath myPath2 = new GraphicsPath(); + myPath2.AddLine(100, 100, 130, 120); + myPath2.AddEllipse(120, 120, 120, 140); + myPath2.AddBezier(130, 160, 170, 160, 150, 130, 200, 110); + ig.DrawPath(new Pen(Color.Blue), myPath2); } else if (s == "Path 2 (Slow)") { @@ -522,7 +528,6 @@ private void Render(IGraphics ig) myGraphicsPath.AddString("a string in a path filled", myFontFamily, 0, 24, myPointF, myStringFormat); myGraphicsPath.AddPie(230, 10, 40, 40, 40, 110); - ig.FillPath(mySolidBrush, myGraphicsPath); ig.DrawPath(new Pen(Color.Green), myGraphicsPath); } diff --git a/SvgNet/.editorconfig b/SvgNet/.editorconfig new file mode 100644 index 0000000..3c597d0 --- /dev/null +++ b/SvgNet/.editorconfig @@ -0,0 +1,12 @@ +[*] +end_of_line = crlf + +[*.xml] +indent_style = space + +[*.cs] +indent_style = space +indent_size = 4 +trim_trailing_whitespace=true +dotnet_sort_system_directives_first=true +csharp_new_line_before_else=false \ No newline at end of file diff --git a/SvgNet/AssemblyInfo.cs b/SvgNet/AssemblyInfo.cs index 171fe64..83843cb 100644 --- a/SvgNet/AssemblyInfo.cs +++ b/SvgNet/AssemblyInfo.cs @@ -20,8 +20,8 @@ [assembly: AssemblyCulture("")] [assembly: AssemblyVersion("1.0.0")] -[assembly: AssemblyFileVersion("1.0.3")] -[assembly: AssemblyInformationalVersion("1.0.3")] +[assembly: AssemblyFileVersion("1.0.4")] +[assembly: AssemblyInformationalVersion("1.0.4")] [assembly: AssemblyDelaySign(false)] [assembly: AssemblyKeyFile("")] diff --git a/SvgNet/SVGGraphics.cs b/SvgNet/SVGGraphics.cs index 6c49b1a..18ec0d8 100644 --- a/SvgNet/SVGGraphics.cs +++ b/SvgNet/SVGGraphics.cs @@ -1972,7 +1972,7 @@ public void DrawLines(Pen pen, Point[] points) /// /// Mainly based on the libgdi+ implementation: https://github.com/mono/libgdiplus/blob/master/src/graphics-cairo.c /// and this SO question reply: https://stackoverflow.com/questions/1790862/how-to-determine-endpoints-of-arcs-in-graphicspath-pathpoints-and-pathtypes-arra - /// from SiiliconMind. + /// from SiliconMind. /// public void DrawPath(Pen pen, GraphicsPath path) { @@ -2011,10 +2011,11 @@ public void DrawPath(Pen pen, GraphicsPath path) start = subpath.PathPoints[i]; bezierCurvePoints[0] = subpath.PathPoints[i]; bezierCurvePointsIndex = 1; + pen.DashStyle = originalPenDashStyle; //Reset pen dash mode to original when starting subpath continue; case PathPointType.Line: DrawLine(pen, start, subpath.PathPoints[i]); //Draw a line segment ftom start point - start = subpath.PathPoints[i]; //Move start point here + start = subpath.PathPoints[i]; //Move start point to line end bezierCurvePoints[0] = subpath.PathPoints[i]; //A line point can also be the start of a Bezier curve bezierCurvePointsIndex = 1; continue; @@ -2026,10 +2027,10 @@ public void DrawPath(Pen pen, GraphicsPath path) bezierCurvePoints = new PointF[4]; bezierCurvePoints[0] = subpath.PathPoints[i]; bezierCurvePointsIndex = 1; + start = subpath.PathPoints[i]; //Move start point to curve end } continue; default: - switch ((PathPointType)subpath.PathTypes[i]) { case PathPointType.DashMode: @@ -2353,7 +2354,7 @@ public void FillPath(Brush brush, GraphicsPath path) } if (!isClosed) { - subpath.CloseAllFigures(); + //subpath.CloseAllFigures(); } PathPointType lastType = (PathPointType)subpath.PathTypes[subpath.PathPoints.Length - 1]; if (subpath.PathTypes.Any(pt => ((PathPointType) pt & PathPointType.PathTypeMask) == PathPointType.Line)) diff --git a/SvgNet/SvgNet.csproj b/SvgNet/SvgNet.csproj index 174e455..c4b10e1 100644 --- a/SvgNet/SvgNet.csproj +++ b/SvgNet/SvgNet.csproj @@ -163,6 +163,7 @@ + diff --git a/SvgNet/svgnetdoc.xml b/SvgNet/svgnetdoc.xml index f033566..80b86b1 100644 --- a/SvgNet/svgnetdoc.xml +++ b/SvgNet/svgnetdoc.xml @@ -507,7 +507,7 @@ Mainly based on the libgdi+ implementation: https://github.com/mono/libgdiplus/blob/master/src/graphics-cairo.c and this SO question reply: https://stackoverflow.com/questions/1790862/how-to-determine-endpoints-of-arcs-in-graphicspath-pathpoints-and-pathtypes-arra - from SiiliconMind. + from SiliconMind.