Skip to content

Commit 41ed0b4

Browse files
authored
Fixes empty path issue (#1131)
* Fixes empty path issue - Fixes issue #1095 - Broken with: Minor optimisations (#1084) commit * Update ReleaseNotes.md
1 parent 18cb5e4 commit 41ed0b4

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

Source/Paths/SvgClosePathSegment.Drawing.cs

+4
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ public override PointF AddToPath(GraphicsPath graphicsPath, PointF start, SvgPat
1111
graphicsPath.CloseFigure();
1212

1313
var end = start;
14+
// Check for empty path, as graphicsPath.PathTypes will throw exception: ArgumentException
15+
if (graphicsPath.PointCount == 0)
16+
return end;
17+
1418
var pathTypes = graphicsPath.PathTypes;
1519
for (var i = graphicsPath.PointCount - 1; i >= 0; --i)
1620
if ((pathTypes[i] & 0x7) == 0)

doc/ReleaseNotes.md

+4
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,15 @@ The release versions are NuGet releases.
55

66
### Changes
77
* added SvgOptions with css parameter to Open so that this can be used for transforming the svgdocument.
8+
* Split tests SVG/PNG files into Issues and W3C Test Suite. W3C Test Suite files are not automatically downloaded.
9+
* Repository clean-up, reducing the download zip size from 22MB to 4.5MB.
10+
811
### Enhancements
912
* made exceptions serializable to be able to cross AppDomain boundaries (see [#826](https://github.com/svg-net/SVG/pull/826))
1013

1114
### Fixes
1215
* fixed XML namespace prefixes are also applied for nodes declaring them (see [PR #1106](https://github.com/svg-net/SVG/pull/1106))
16+
* fixed Parameter is not valid (see [PR #1131](https://github.com/svg-net/SVG/pull/1131))
1317

1418
## [Version 3.4.6](https://www.nuget.org/packages/Svg/3.4.6) (2023-11-16)
1519

0 commit comments

Comments
 (0)