Issue with Points in scientific notation

Aug 12, 2010 at 6:10 AM


Occasionally, a point within a path gets stored in the svg file in scientific notation ie (72.6261,6.5e-4) - Seems to happen a lot when converting Text to Paths.

This breaks the SplitCommands and ParseCoordinates methods in SvgPathBuilder.cs

I've made the following changes as a work around, I'm sure someone can come up with a more elegant solution.

In SplitCommands, I've modified the line:

if (char.IsLetter(path[i]))

to be

if (char.IsLetter(path[i]) && path[i]!='e')

and in ParseCoordinates, I've modified the line:

var parts = coords.Remove(0, 1).Replace("-", " -").Split(new[] { ',', ' ', '\r', '\n' },

to be

var parts = coords.Remove(0, 1).Split(new[] { ',', ' ', '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries);