Explorar o código

WebGLRenderTarget: Refactor copy(). (#23237)

Michael Herzog %!s(int64=3) %!d(string=hai) anos
pai
achega
0a8fa90351
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      src/renderers/WebGLRenderTarget.js

+ 4 - 1
src/renderers/WebGLRenderTarget.js

@@ -86,7 +86,10 @@ class WebGLRenderTarget extends EventDispatcher {
 		this.viewport.copy( source.viewport );
 		this.viewport.copy( source.viewport );
 
 
 		this.texture = source.texture.clone();
 		this.texture = source.texture.clone();
-		this.texture.image = { ...this.texture.image }; // See #20328.
+
+		// ensure image object is not shared, see #20328
+
+		this.texture.image = Object.assign( {}, source.texture.image );
 
 
 		this.depthBuffer = source.depthBuffer;
 		this.depthBuffer = source.depthBuffer;
 		this.stencilBuffer = source.stencilBuffer;
 		this.stencilBuffer = source.stencilBuffer;