Allow for scientific notation in SVG path data
authorNikita Kitaev <nikitakit@gmail.com>
Fri, 2 Apr 2010 01:45:44 +0000 (18:45 -0700)
committerNikita Kitaev <nikitakit@gmail.com>
Fri, 2 Apr 2010 01:45:44 +0000 (18:45 -0700)
synfig-core/src/modules/mod_svg/svg_parser.cpp

index 680aa4f..f7b6350 100644 (file)
@@ -1780,7 +1780,7 @@ Svg_parser::get_tokens_path(String path){ //mini path lexico-parser
                                        else if(a=='V'){ e=15; i++;}
                                        else if(a=='H'){ e=16; i++;}
                                        else if(a=='z' || a=='Z'){ e=17; i++;}
-                                       else if(a=='-' ||a=='.'|| isdigit (a)){ e=18;}
+                                       else if(a=='-' || a=='.' || a=='e' || a=='E' || isdigit (a)){ e=18;}
                                        else if(a==','){ e=19; i++;}
                                        else if(a==' '){i++;}
                                        break;
@@ -1804,7 +1804,7 @@ Svg_parser::get_tokens_path(String path){ //mini path lexico-parser
                        case 16: tokens.push_back("H"); e=0; break;
 
                        case 17: tokens.push_back("z"); e=0; break;//loop
-                       case 18: if(a=='-'||a=='.'|| isdigit (a)){
+                       case 18: if(a=='-' || a=='.' || a=='e' || a=='E' || isdigit (a)){
                                                buffer.append(path.substr(i,1));i++;
                                        }else{
                                                e=20;