Selaa lähdekoodia

SVGLoader: Make node transform parsing more robust. (#31985)

Michael Herzog 3 kuukautta sitten
vanhempi
sitoutus
2a028849d7
1 muutettua tiedostoa jossa 2 lisäystä ja 2 poistoa
  1. 2 2
      examples/jsm/loaders/SVGLoader.js

+ 2 - 2
examples/jsm/loaders/SVGLoader.js

@@ -1502,8 +1502,8 @@ class SVGLoader extends Loader {
 
 			if ( node.nodeName === 'use' && ( node.hasAttribute( 'x' ) || node.hasAttribute( 'y' ) ) ) {
 
-				const tx = parseFloatWithUnits( node.getAttribute( 'x' ) );
-				const ty = parseFloatWithUnits( node.getAttribute( 'y' ) );
+				const tx = parseFloatWithUnits( node.getAttribute( 'x' ) || 0 );
+				const ty = parseFloatWithUnits( node.getAttribute( 'y' ) || 0 );
 
 				transform.translate( tx, ty );
 

粤ICP备19079148号