Commit addc38a7 authored by sovietmagic's avatar sovietmagic
Browse files

SvgPointCollection.ToString method modified to return valid coordinate string...

SvgPointCollection.ToString method modified to return valid coordinate string with each coordinate pair separated by whitespace and their x and y values separated by comma.
parent 2bf55043
......@@ -15,13 +15,22 @@ namespace Svg
{
public override string ToString()
{
string ret = "";
foreach (var unit in this)
var builder = new StringBuilder();
for (var i = 0; i < Count; i += 2)
{
ret += unit.ToString() + " ";
if (i + 1 < Count)
{
if (i > 1)
{
builder.Append(" ");
}
// we don't need unit type
builder.Append(this[i].Value.ToString(CultureInfo.InvariantCulture));
builder.Append(",");
builder.Append(this[i + 1].Value.ToString(CultureInfo.InvariantCulture));
}
}
return ret;
return builder.ToString();
}
}
......
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