소스 검색

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 10 년 전
부모
커밋
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 );