Commit 5d3b01aa authored by Tebjan Halm's avatar Tebjan Halm
Browse files

fixed path coordinate parser

parent fa870975
Source/bin/
Source/obj/
Source/Svg.csproj.user
Source/Svg.suo
......@@ -6,6 +6,7 @@ using System.Drawing;
using System.Globalization;
using System.Linq;
using Svg.Pathing;
using System.Text.RegularExpressions;
namespace Svg
{
......@@ -246,14 +247,13 @@ namespace Svg
private static IEnumerable<float> ParseCoordinates(string coords)
{
// TODO: Handle "1-1" (new PointF(1, -1);
// var parts = coords.Remove(0, 1).Replace("-", " -").Split(new[] { ',', ' ', '\r', '\n' },StringSplitOptions.RemoveEmptyEntries);
//gareth: removed replacing '-' with ' -' - was screwing up scientific notiation
var parts = coords.Remove(0, 1).Split(new[] { ',', ' ', '\r', '\n' },StringSplitOptions.RemoveEmptyEntries);
var parts = Regex.Split(coords.Remove(0, 1), @"[\s,]|(?=(?<!e)-)");
for (var i = 0; i < parts.Length; i++)
for (int i = 0; i < parts.Length; i++)
{
yield return float.Parse(parts[i].Trim(), NumberStyles.Float, CultureInfo.InvariantCulture);
if (!String.IsNullOrEmpty(parts[i]))
yield return float.Parse(parts[i].Trim(), NumberStyles.Float, CultureInfo.InvariantCulture);
}
}
......
......@@ -48,7 +48,7 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugType>Full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<OutputPath>..\..\vvvv\public\common\src\thirdparty\</OutputPath>
<DefineConstants>TRACE;DEBUG;REFLECTION</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
......@@ -67,6 +67,7 @@
</CodeAnalysisRules>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<DebugSymbols>false</DebugSymbols>
<DocumentationFile>bin\Release\Svg.XML</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.JScript" />
......
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