Browse Source

make autoResize optional. Fixes #2969

gero3 12 years ago
parent
commit
ed00cd63fa
1 changed files with 13 additions and 4 deletions
  1. 13 4
      src/renderers/WebGLRenderer.js

+ 13 - 4
src/renderers/WebGLRenderer.js

@@ -293,15 +293,24 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 	};
 
-	this.setSize = function ( width, height ) {
+	this.setSize = function ( width, height, autoResize ) {
+
+		if ( autoResize === undefined ) {
+			autoResize = true;	
+		}
 
 		_canvas.width = width * this.devicePixelRatio;
 		_canvas.height = height * this.devicePixelRatio;
-
-		_canvas.style.width = width + 'px';
-		_canvas.style.height = height + 'px';
+			
+		if ( autoResize ){
+			
+			_canvas.style.width = width + 'px';
+			_canvas.style.height = height + 'px';
+		
+		}
 
 		this.setViewport( 0, 0, _canvas.width, _canvas.height );
+		
 
 	};