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

Rectangle: Added copy().

上级 3d38cc3a
......@@ -112,8 +112,10 @@ THREE.EffectComposer.prototype = {
var pixelRatio = this.renderer.getPixelRatio();
renderTarget.width = Math.floor( this.renderer.context.canvas.width / pixelRatio );
renderTarget.height = Math.floor( this.renderer.context.canvas.height / pixelRatio );
renderTarget.setSize(
Math.floor( this.renderer.context.canvas.width / pixelRatio ),
Math.floor( this.renderer.context.canvas.height / pixelRatio )
);
}
......
......@@ -21,6 +21,17 @@ THREE.Rectangle.prototype = {
return this;
},
copy: function ( source ) {
this.x = source.x;
this.y = source.y;
this.width = source.width;
this.height = source.height;
return this;
}
};
......@@ -40,12 +40,12 @@ THREE.WebGLRenderTarget.prototype = {
this.width = width;
this.height = height;
this.viewport.set( 0, 0, width, height );
this.dispose();
}
this.viewport.set( 0, 0, width, height );
},
setViewport: function ( x, y, width, height ) {
......@@ -65,6 +65,8 @@ THREE.WebGLRenderTarget.prototype = {
this.width = source.width;
this.height = source.height;
this.viewport.copy( source.viewport );
this.texture = source.texture.clone();
this.depthBuffer = source.depthBuffer;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册