Răsfoiți Sursa

Fix Texture.image !== null <- https://github.com/mrdoob/three.js/pull/22846 (#23436)

sunag 3 ani în urmă
părinte
comite
e619fe5426
1 a modificat fișierele cu 2 adăugiri și 2 ștergeri
  1. 2 2
      examples/jsm/renderers/webgpu/WebGPUTextures.js

+ 2 - 2
examples/jsm/renderers/webgpu/WebGPUTextures.js

@@ -365,7 +365,7 @@ class WebGPUTextures {
 
 		} else {
 
-			if ( image !== undefined ) {
+			if ( image !== null ) {
 
 				// assume HTMLImageElement, HTMLCanvasElement or ImageBitmap
 
@@ -701,7 +701,7 @@ class WebGPUTextures {
 			height = ( image.length > 0 ) ? image[ 0 ].height : 1;
 			depth = 6; // one image for each side of the cube map
 
-		} else if ( image !== undefined ) {
+		} else if ( image !== null ) {
 
 			width = image.width;
 			height = image.height;