public SvgRect(string str)
{
string replacedStr = Regex.Replace(str, @"(\s|,)+", ",");
string[] tokens = replacedStr.Split(new char[]{','});
if(tokens.Length == 4)
{
this.x = SvgNumber.ParseToFloat(tokens[0]);
this.y = SvgNumber.ParseToFloat(tokens[1]);
this.width = SvgNumber.ParseToFloat(tokens[2]);
this.height = SvgNumber.ParseToFloat(tokens[3]);
}
else
{
throw new SvgException(SvgExceptionType.SvgInvalidValueErr, "Invalid SvgRect value: " + str);
}
}