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
[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>
......
......@@ -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;
}
}
......
......@@ -11,7 +11,7 @@ namespace Svg.Pathing
internal SvgPath _owner;
private List<SvgPathSegment> _segments;
internal SvgPathSegmentList()
public SvgPathSegmentList()
{
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