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
11c363d8
Commit
11c363d8
authored
Dec 06, 2013
by
Tebjan Halm
Browse files
svg path serializes with invariant culture now
parent
cf8f77dc
Changes
3
Show whitespace changes
Inline
Side-by-side
Source/Paths/SvgPath.cs
View file @
11c363d8
...
...
@@ -17,7 +17,6 @@ namespace Svg
[
SvgElement
(
"path"
)]
public
class
SvgPath
:
SvgVisualElement
{
private
SvgPathSegmentList
_pathData
;
private
GraphicsPath
_path
;
private
int
_pathLength
;
...
...
@@ -27,11 +26,11 @@ namespace Svg
[
SvgAttribute
(
"d"
)]
public
SvgPathSegmentList
PathData
{
get
{
return
this
.
_pathData
;
}
get
{
return
this
.
Attributes
.
GetAttribute
<
SvgPathSegmentList
>(
"d"
)
;
}
set
{
this
.
_pathData
=
value
;
this
.
_pathData
.
_owner
=
this
;
this
.
Attributes
[
"d"
]
=
value
;
value
.
_owner
=
this
;
this
.
IsPathDirty
=
true
;
}
}
...
...
@@ -98,7 +97,7 @@ namespace Svg
internal
void
OnPathUpdated
()
{
this
.
IsPathDirty
=
true
;
OnAttributeChanged
(
new
AttributeEventArgs
{
Attribute
=
"d"
,
Value
=
this
.
PathData
});
OnAttributeChanged
(
new
AttributeEventArgs
{
Attribute
=
"d"
,
Value
=
this
.
Attributes
.
GetAttribute
<
SvgPathSegmentList
>(
"d"
)
});
}
/// <summary>
...
...
@@ -123,8 +122,9 @@ namespace Svg
/// </summary>
public
SvgPath
()
{
this
.
_pathData
=
new
SvgPathSegmentList
();
this
.
_pathData
.
_owner
=
this
;
var
pathData
=
new
SvgPathSegmentList
();
this
.
Attributes
[
"d"
]
=
pathData
;
pathData
.
_owner
=
this
;
}
/// <summary>
...
...
Source/Paths/SvgPathBuilder.cs
View file @
11c363d8
...
...
@@ -5,8 +5,10 @@ using System.Diagnostics;
using
System.Drawing
;
using
System.Globalization
;
using
System.Linq
;
using
Svg.Pathing
;
using
System.Text.RegularExpressions
;
using
System.Threading
;
using
Svg.Pathing
;
namespace
Svg
{
...
...
@@ -298,7 +300,11 @@ namespace Svg
if
(
paths
!=
null
)
{
return
string
.
Join
(
" "
,
paths
.
Select
(
p
=>
p
.
ToString
()).
ToArray
());
var
curretCulture
=
CultureInfo
.
CurrentCulture
;
Thread
.
CurrentThread
.
CurrentCulture
=
CultureInfo
.
InvariantCulture
;
var
s
=
string
.
Join
(
" "
,
paths
.
Select
(
p
=>
p
.
ToString
()).
ToArray
());
Thread
.
CurrentThread
.
CurrentCulture
=
curretCulture
;
return
s
;
}
}
...
...
Source/Paths/SvgPathSegmentList.cs
View file @
11c363d8
...
...
@@ -11,7 +11,7 @@ namespace Svg.Pathing
internal
SvgPath
_owner
;
private
List
<
SvgPathSegment
>
_segments
;
internal
SvgPathSegmentList
()
public
SvgPathSegmentList
()
{
this
.
_segments
=
new
List
<
SvgPathSegment
>();
}
...
...
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