Browse Source

SVGLoader: Fix bug with transforms of next neighbours nodes

yomboprime 6 năm trước cách đây
mục cha
commit
bf8d8f671e
1 tập tin đã thay đổi với 4 bổ sung1 xóa
  1. 4 1
      examples/js/loaders/SVGLoader.js

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

@@ -120,7 +120,10 @@ THREE.SVGLoader.prototype = {
 
 			if ( transform ) {
 
-				currentTransform.copy( transformStack.pop() );
+				transformStack.pop();
+
+				if ( transformStack.length > 0 ) currentTransform.copy( transformStack[ transformStack.length - 1 ] );
+				else currentTransform.identity();
 
 			}