소스 검색

Merge pull request #11445 from 06wj/patch-pixelRatio

Fix setViewport & setScissor pixelRatio bug
Mr.doob 8 년 전
부모
커밋
ab5bcc4f09
1개의 변경된 파일6개의 추가작업 그리고 4개의 파일을 삭제
  1. 6 4
      src/renderers/WebGLRenderer.js

+ 6 - 4
src/renderers/WebGLRenderer.js

@@ -436,14 +436,16 @@ function WebGLRenderer( parameters ) {
 
 	this.setViewport = function ( x, y, width, height ) {
 
-		state.viewport( _viewport.set( x, y, width, height ) );
-
+		_viewport.set( x, y, width, height )
+		state.viewport( _currentViewport.copy( _viewport ).multiplyScalar( _pixelRatio ) );
+	
 	};
 
 	this.setScissor = function ( x, y, width, height ) {
 
-		state.scissor( _scissor.set( x, y, width, height ) );
-
+		_scissor.set( x, y, width, height )
+		state.scissor( _currentScissor.copy( _scissor ).multiplyScalar( _pixelRatio ) );
+	
 	};
 
 	this.setScissorTest = function ( boolean ) {