From fd7860a2c13ebb658ab5a4c2d35061741df4a7f3 Mon Sep 17 00:00:00 2001 From: joreg Date: Mon, 26 Aug 2024 23:14:41 +0200 Subject: [PATCH] Fixes an issue with missing arguments when the svg did not contain a space after the argument --- Svg2Gcode/Svg/Paths/PathShapeParser.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Svg2Gcode/Svg/Paths/PathShapeParser.cs b/Svg2Gcode/Svg/Paths/PathShapeParser.cs index f4e59f6..5307e1f 100644 --- a/Svg2Gcode/Svg/Paths/PathShapeParser.cs +++ b/Svg2Gcode/Svg/Paths/PathShapeParser.cs @@ -39,6 +39,10 @@ private IEnumerable parse(string data) skipWhiteSpace = false; if (char.IsLetter(commandKey) && commandKey != 'e') // new command { + var arg = builder.ToString(); + if (!string.IsNullOrEmpty(arg)) + arguments.Add(arg); + if (i > 0) // process the previous command { ICommandParser parser = getParser(previousCommandKey); @@ -47,6 +51,7 @@ private IEnumerable parse(string data) previousCommandKey = commandKey; arguments.Clear(); + builder.Clear(); skipWhiteSpace = true; } else if (commandKey == ' ' || commandKey == ',')