瀏覽代碼

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
 
-			onLoad( doc.firstChild );
+			onLoad( doc.documentElement );
 
 		}, onProgress, onError );