Skip to content

Commit 2a02884

Browse files
authored
SVGLoader: Make node transform parsing more robust. (#31985)
1 parent 2cbc7af commit 2a02884

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/jsm/loaders/SVGLoader.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1502,8 +1502,8 @@ class SVGLoader extends Loader {
15021502

15031503
if ( node.nodeName === 'use' && ( node.hasAttribute( 'x' ) || node.hasAttribute( 'y' ) ) ) {
15041504

1505-
const tx = parseFloatWithUnits( node.getAttribute( 'x' ) );
1506-
const ty = parseFloatWithUnits( node.getAttribute( 'y' ) );
1505+
const tx = parseFloatWithUnits( node.getAttribute( 'x' ) || 0 );
1506+
const ty = parseFloatWithUnits( node.getAttribute( 'y' ) || 0 );
15071507

15081508
transform.translate( tx, ty );
15091509

0 commit comments

Comments
 (0)