瀏覽代碼

PMREMGenerator: Use logical OR instead of nullish coalescing. (#23488)

Michael Herzog 3 年之前
父節點
當前提交
e8de8f09ca
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/extras/PMREMGenerator.js

+ 1 - 1
src/extras/PMREMGenerator.js

@@ -224,7 +224,7 @@ class PMREMGenerator {
 
 		if ( texture.mapping === CubeReflectionMapping || texture.mapping === CubeRefractionMapping ) {
 
-			this._setSize( texture.image.length === 0 ? 16 : texture.image[ 0 ].width ?? texture.image[ 0 ].image.width );
+			this._setSize( texture.image.length === 0 ? 16 : ( texture.image[ 0 ].width || texture.image[ 0 ].image.width ) );
 
 		} else { // Equirectangular