瀏覽代碼

Revert 7662fe98a48f7948f3aeb2ee2c95c14b158f7206 (oops)

Garrett Johnson 2 年之前
父節點
當前提交
82bd9a35dc
共有 1 個文件被更改,包括 2 次插入20 次删除
  1. 2 20
      src/renderers/WebGLRenderer.js

+ 2 - 20
src/renderers/WebGLRenderer.js

@@ -462,16 +462,7 @@ function WebGLRenderer( parameters = {} ) {
 
 		}
 
-		_currentViewport.copy( _viewport )
-
-		// pixel ratio only applies to the canvas
-		if ( _currentRenderTarget === null ) {
-
-			_currentViewport.multiplyScalar( _pixelRatio );
-
-		}
-
-		state.viewport( _currentViewport.floor() );
+		state.viewport( _currentViewport.copy( _viewport ).multiplyScalar( _pixelRatio ).floor() );
 
 	};
 
@@ -493,16 +484,7 @@ function WebGLRenderer( parameters = {} ) {
 
 		}
 
-		_currentScissor.copy( _scissor );
-
-		// pixel ratio only applies to the canvas
-		if ( _currentRenderTarget === null ) {
-
-			_currentScissor.multiplyScalar( _pixelRatio );
-
-		}
-
-		state.scissor( _currentScissor.floor() );
+		state.scissor( _currentScissor.copy( _scissor ).multiplyScalar( _pixelRatio ).floor() );
 
 	};