提交 5f78a278 编写于 作者: M Mr.doob

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

Renamed new setSize() autoResize parameter to updateSyle. Also applied to CanvasRenderer and WebGLRenderer3.
上级 60c00bdb
......@@ -139,7 +139,7 @@ THREE.CanvasRenderer = function ( parameters ) {
this.supportsVertexTextures = function () {};
this.setFaceCulling = function () {};
this.setSize = function ( width, height ) {
this.setSize = function ( width, height, updateStyle ) {
_canvasWidth = width * this.devicePixelRatio;
_canvasHeight = height * this.devicePixelRatio;
......@@ -150,8 +150,12 @@ THREE.CanvasRenderer = function ( parameters ) {
_canvas.width = _canvasWidth;
_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(
new THREE.Vector2( - _canvasWidthHalf, - _canvasHeightHalf ),
......
......@@ -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.height = height * this.devicePixelRatio;
if ( autoResize ){
if ( updateStyle !== false ) {
_canvas.style.width = width + 'px';
_canvas.style.height = height + 'px';
}
this.setViewport( 0, 0, _canvas.width, _canvas.height );
};
......
......@@ -237,11 +237,18 @@ THREE.WebGLRenderer3 = function ( parameters ) {
};
this.setSize = function ( width, height ) {
this.setSize = function ( width, height, updateStyle ) {
canvas.width = width;
canvas.height = height;
if ( updateStyle !== false ) {
canvas.style.width = width + 'px';
canvas.style.height = height + 'px';
}
gl.viewport( 0, 0, canvas.width, canvas.height );
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册