浏览代码

WebGLRenderer: Cleaned ArrayCamera viewport/scissor code.

Mr.doob 8 年之前
父节点
当前提交
8fd10d8520
共有 1 个文件被更改,包括 7 次插入8 次删除
  1. 7 8
      src/renderers/WebGLRenderer.js

+ 7 - 8
src/renderers/WebGLRenderer.js

@@ -1456,14 +1456,13 @@ function WebGLRenderer( parameters ) {
 					var camera2 = cameras[ j ];
 					var bounds = camera2.bounds;
 
-					_this.setViewport(
-						bounds.x * _width * _pixelRatio, bounds.y * _height * _pixelRatio,
-						bounds.z * _width * _pixelRatio, bounds.w * _height * _pixelRatio
-					);
-					_this.setScissor(
-						bounds.x * _width * _pixelRatio, bounds.y * _height * _pixelRatio,
-						bounds.z * _width * _pixelRatio, bounds.w * _height * _pixelRatio
-					);
+					var x = bounds.x * _width * _pixelRatio;
+					var y = bounds.y * _height * _pixelRatio;
+					var width = bounds.z * _width * _pixelRatio;
+					var height = bounds.w * _height * _pixelRatio;
+
+					_this.setViewport( x, y, width, height );
+					_this.setScissor( x, y, width, height );
 					_this.setScissorTest( true );
 
 					renderObject( object, scene, camera2, geometry, material, group );