Explorar o código

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

Kentaro Ozeki %!s(int64=2) %!d(string=hai) anos
pai
achega
2ca30cf1fc
Modificáronse 1 ficheiros con 2 adicións e 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();