Browse Source

WebGLRenderer: Use self instead of window. (#23686)

* WebGLAnimation: use global request/cancelAnimationFrame if window context is not available (OffscreenCanvas)

* Use self instead of window
- revert WebGLAnimation changes

Co-authored-by: Bernd Meyer <[email protected]>
begmec 3 years ago
parent
commit
be137e6da5
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/renderers/WebGLRenderer.js

+ 1 - 1
src/renderers/WebGLRenderer.js

@@ -891,7 +891,7 @@ function WebGLRenderer( parameters = {} ) {
 	const animation = new WebGLAnimation();
 	animation.setAnimationLoop( onAnimationFrame );
 
-	if ( typeof window !== 'undefined' ) animation.setContext( window );
+	if ( typeof self !== 'undefined' ) animation.setContext( self );
 
 	this.setAnimationLoop = function ( callback ) {