Browse Source

Renamed new setSize() autoResize parameter to updateSyle. Also applied to CanvasRenderer and WebGLRenderer3.

Mr.doob 12 years ago
parent
commit
5f78a2786b

+ 7 - 3
src/renderers/CanvasRenderer.js

@@ -139,7 +139,7 @@ THREE.CanvasRenderer = function ( parameters ) {
 	this.supportsVertexTextures = function () {};
 	this.supportsVertexTextures = function () {};
 	this.setFaceCulling = function () {};
 	this.setFaceCulling = function () {};
 
 
-	this.setSize = function ( width, height ) {
+	this.setSize = function ( width, height, updateStyle ) {
 
 
 		_canvasWidth = width * this.devicePixelRatio;
 		_canvasWidth = width * this.devicePixelRatio;
 		_canvasHeight = height * this.devicePixelRatio;
 		_canvasHeight = height * this.devicePixelRatio;
@@ -150,8 +150,12 @@ THREE.CanvasRenderer = function ( parameters ) {
 		_canvas.width = _canvasWidth;
 		_canvas.width = _canvasWidth;
 		_canvas.height = _canvasHeight;
 		_canvas.height = _canvasHeight;
 
 
-		_canvas.style.width = width + 'px';
-		_canvas.style.height = height + 'px';
+		if ( updateStyle !== false ) {
+
+			_canvas.style.width = width + 'px';
+			_canvas.style.height = height + 'px';
+
+		}
 
 
 		_clipBox.set(
 		_clipBox.set(
 			new THREE.Vector2( - _canvasWidthHalf, - _canvasHeightHalf ),
 			new THREE.Vector2( - _canvasWidthHalf, - _canvasHeightHalf ),

+ 5 - 10
src/renderers/WebGLRenderer.js

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

+ 8 - 1
src/renderers/WebGLRenderer3.js

@@ -237,11 +237,18 @@ THREE.WebGLRenderer3 = function ( parameters ) {
 
 
 	};
 	};
 
 
-	this.setSize = function ( width, height ) {
+	this.setSize = function ( width, height, updateStyle ) {
 
 
 		canvas.width = width;
 		canvas.width = width;
 		canvas.height = height;
 		canvas.height = height;
 
 
+		if ( updateStyle !== false ) {
+
+			canvas.style.width = width + 'px';
+			canvas.style.height = height + 'px';
+
+		}
+
 		gl.viewport( 0, 0, canvas.width, canvas.height );
 		gl.viewport( 0, 0, canvas.width, canvas.height );
 
 
 	};
 	};