Skip to content

Commit f0c7772

Browse files
committed
Fix parsing closed SVG paths
1 parent 4963028 commit f0c7772

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

NGraphics/SvgReader.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -490,11 +490,11 @@ Transform ReadTransform (string raw)
490490

491491
static readonly char[] WSC = new char[] { ',', ' ', '\t', '\n', '\r' };
492492

493+
static Regex pathRegex = new Regex(@"[MLHVCSQTAZmlhvcsqtaz](?:[0-9\.,\-\s]|$)+", RegexOptions.Singleline);
494+
493495
void ReadPath (Path p, string pathDescriptor)
494496
{
495-
Regex regex = new Regex(@"[MLHVCSQTAZmlhvcsqtaz][0-9\.,\-\s\n]+", RegexOptions.Singleline);
496-
497-
Match m = regex.Match(pathDescriptor);
497+
Match m = pathRegex.Match(pathDescriptor);
498498
while(m.Success)
499499
{
500500
var match = m.Value.Trim();
0 Bytes
Loading
0 Bytes
Loading

0 commit comments

Comments
 (0)