ソースを参照

CanvasRenderer .setClearColor() and .setClearColorHex() now sets opacity to 1 when null. Fixes #1636.

Mr.doob 13 年 前
コミット
84375eed95
1 ファイル変更4 行追加4 行削除
  1. 4 4
      src/renderers/CanvasRenderer.js

+ 4 - 4
src/renderers/CanvasRenderer.js

@@ -120,19 +120,19 @@ THREE.CanvasRenderer = function ( parameters ) {
 
 	};
 
-	this.setClearColor = function( color, opacity ) {
+	this.setClearColor = function ( color, opacity ) {
 
 		_clearColor.copy( color );
-		_clearOpacity = opacity;
+		_clearOpacity = opacity !== undefined ? opacity : 1;
 
 		_clearRect.set( - _canvasWidthHalf, - _canvasHeightHalf, _canvasWidthHalf, _canvasHeightHalf );
 
 	};
 
-	this.setClearColorHex = function( hex, opacity ) {
+	this.setClearColorHex = function ( hex, opacity ) {
 
 		_clearColor.setHex( hex );
-		_clearOpacity = opacity;
+		_clearOpacity = opacity !== undefined ? opacity : 1;
 
 		_clearRect.set( - _canvasWidthHalf, - _canvasHeightHalf, _canvasWidthHalf, _canvasHeightHalf );