فهرست منبع

Updating SVGLoader to handle comments

The documentElement will always return the svg node. Otherwise it used to fail, if there was a comment node before it. Comments are commonly seen when an svg is exported from Adobe Illustrator.
Agniva De Sarker 9 سال پیش
والد
کامیت
ef9d00bbee
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      examples/js/loaders/SVGLoader.js

+ 1 - 1
examples/js/loaders/SVGLoader.js

@@ -25,7 +25,7 @@ THREE.SVGLoader.prototype = {
 
 
 			var doc = parser.parseFromString( svgString, 'image/svg+xml' );  // application/xml
 			var doc = parser.parseFromString( svgString, 'image/svg+xml' );  // application/xml
 
 
-			onLoad( doc.firstChild );
+			onLoad( doc.documentElement );
 
 
 		}, onProgress, onError );
 		}, onProgress, onError );