From 8fd10d85205077d715da0d06694b55f1a3dfe307 Mon Sep 17 00:00:00 2001 From: "Mr.doob" Date: Thu, 1 Jun 2017 11:23:23 -0700 Subject: [PATCH] WebGLRenderer: Cleaned ArrayCamera viewport/scissor code. --- src/renderers/WebGLRenderer.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/renderers/WebGLRenderer.js b/src/renderers/WebGLRenderer.js index 469fab41173b6c..e3c18e9fa1cf99 100644 --- a/src/renderers/WebGLRenderer.js +++ b/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 );