Commit 11c363d8 authored by Tebjan Halm's avatar Tebjan Halm
Browse files

svg path serializes with invariant culture now

parent cf8f77dc
...@@ -17,7 +17,6 @@ namespace Svg ...@@ -17,7 +17,6 @@ namespace Svg
[SvgElement("path")] [SvgElement("path")]
public class SvgPath : SvgVisualElement public class SvgPath : SvgVisualElement
{ {
private SvgPathSegmentList _pathData;
private GraphicsPath _path; private GraphicsPath _path;
private int _pathLength; private int _pathLength;
...@@ -27,11 +26,11 @@ namespace Svg ...@@ -27,11 +26,11 @@ namespace Svg
[SvgAttribute("d")] [SvgAttribute("d")]
public SvgPathSegmentList PathData public SvgPathSegmentList PathData
{ {
get { return this._pathData; } get { return this.Attributes.GetAttribute<SvgPathSegmentList>("d"); }
set set
{ {
this._pathData = value; this.Attributes["d"] = value;
this._pathData._owner = this; value._owner = this;
this.IsPathDirty = true; this.IsPathDirty = true;
} }
} }
...@@ -98,7 +97,7 @@ namespace Svg ...@@ -98,7 +97,7 @@ namespace Svg
internal void OnPathUpdated() internal void OnPathUpdated()
{ {
this.IsPathDirty = true; this.IsPathDirty = true;
OnAttributeChanged(new AttributeEventArgs{ Attribute = "d", Value = this.PathData }); OnAttributeChanged(new AttributeEventArgs{ Attribute = "d", Value = this.Attributes.GetAttribute<SvgPathSegmentList>("d") });
} }
/// <summary> /// <summary>
...@@ -123,8 +122,9 @@ namespace Svg ...@@ -123,8 +122,9 @@ namespace Svg
/// </summary> /// </summary>
public SvgPath() public SvgPath()
{ {
this._pathData = new SvgPathSegmentList(); var pathData = new SvgPathSegmentList();
this._pathData._owner = this; this.Attributes["d"] = pathData;
pathData._owner = this;
} }
/// <summary> /// <summary>
......
...@@ -5,8 +5,10 @@ using System.Diagnostics; ...@@ -5,8 +5,10 @@ using System.Diagnostics;
using System.Drawing; using System.Drawing;
using System.Globalization; using System.Globalization;
using System.Linq; using System.Linq;
using Svg.Pathing;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using System.Threading;
using Svg.Pathing;
namespace Svg namespace Svg
{ {
...@@ -298,7 +300,11 @@ namespace Svg ...@@ -298,7 +300,11 @@ namespace Svg
if (paths != null) 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;
} }
} }
......
...@@ -11,7 +11,7 @@ namespace Svg.Pathing ...@@ -11,7 +11,7 @@ namespace Svg.Pathing
internal SvgPath _owner; internal SvgPath _owner;
private List<SvgPathSegment> _segments; private List<SvgPathSegment> _segments;
internal SvgPathSegmentList() public SvgPathSegmentList()
{ {
this._segments = new List<SvgPathSegment>(); this._segments = new List<SvgPathSegment>();
} }
......
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