2
0
Эх сурвалжийг харах

Merge pull request #16090 from yomboprime/svg_transform_neighbour

SVGLoader: Fix bug with transforms of brother nodes
Mr.doob 6 жил өмнө
parent
commit
66f0f75c65

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

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