瀏覽代碼

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

Victor Nakoryakov 4 年之前
父節點
當前提交
6530183998
共有 1 個文件被更改,包括 2 次插入2 次删除
  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 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 h = parseFloatWithUnits( node.getAttribute( 'height' ) );