Browse Source

SVGLoader: fix round rects when only rx or ry is specified (#22124)

Victor Nakoryakov 4 years ago
parent
commit
6530183998
1 changed files with 2 additions and 2 deletions
  1. 2 2
      examples/jsm/loaders/SVGLoader.js

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

@@ -758,8 +758,8 @@ class SVGLoader extends Loader {
 
 
 			const x = parseFloatWithUnits( node.getAttribute( 'x' ) || 0 );
 			const x = parseFloatWithUnits( node.getAttribute( 'x' ) || 0 );
 			const y = parseFloatWithUnits( node.getAttribute( 'y' ) || 0 );
 			const y = parseFloatWithUnits( node.getAttribute( 'y' ) || 0 );
-			const rx = parseFloatWithUnits( node.getAttribute( 'rx' ) || 0 );
-			const ry = parseFloatWithUnits( node.getAttribute( 'ry' ) || 0 );
+			const rx = parseFloatWithUnits( node.getAttribute( 'rx' ) || node.getAttribute( 'ry' ) || 0 );
+			const ry = parseFloatWithUnits( node.getAttribute( 'ry' ) || node.getAttribute( 'rx' ) || 0 );
 			const w = parseFloatWithUnits( node.getAttribute( 'width' ) );
 			const w = parseFloatWithUnits( node.getAttribute( 'width' ) );
 			const h = parseFloatWithUnits( node.getAttribute( 'height' ) );
 			const h = parseFloatWithUnits( node.getAttribute( 'height' ) );