Explorar el Código

SVGLoader: Fix parsing of 'points' attribute (#25206)

Kentaro Ozeki hace 2 años
padre
commit
2ca30cf1fc
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. 2 2
      examples/jsm/loaders/SVGLoader.js

+ 2 - 2
examples/jsm/loaders/SVGLoader.js

@@ -866,7 +866,7 @@ class SVGLoader extends Loader {
 
 			}
 
-			const regex = /(-?[\d\.?]+)[,|\s](-?[\d\.?]+)/g;
+			const regex = /([+-]?\d*\.?\d+(?:e[+-]?\d+)?)(?:,|\s)([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/g;
 
 			const path = new ShapePath();
 
@@ -901,7 +901,7 @@ class SVGLoader extends Loader {
 
 			}
 
-			const regex = /(-?[\d\.?]+)[,|\s](-?[\d\.?]+)/g;
+			const regex = /([+-]?\d*\.?\d+(?:e[+-]?\d+)?)(?:,|\s)([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/g;
 
 			const path = new ShapePath();