Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ImportedProjects
SVG
Commits
5d3b01aa
Commit
5d3b01aa
authored
Jul 16, 2012
by
Tebjan Halm
Browse files
fixed path coordinate parser
parent
fa870975
Changes
3
Hide whitespace changes
Inline
Side-by-side
.gitignore
0 → 100644
View file @
5d3b01aa
Source/bin/
Source/obj/
Source/Svg.csproj.user
Source/Svg.suo
Source/Paths/SvgPathBuilder.cs
View file @
5d3b01aa
...
...
@@ -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
);
}
}
...
...
Source/Svg.csproj
View file @
5d3b01aa
...
...
@@ -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"
/>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment