浏览代码

fix misspelled and typeof only once

ranbuch 6 年之前
父节点
当前提交
f70a3e4efb
共有 2 个文件被更改,包括 5 次插入5 次删除
  1. 2 2
      src/renderers/WebGLRenderer.js
  2. 3 3
      src/renderers/webgl/WebGLRenderLists.js

+ 2 - 2
src/renderers/WebGLRenderer.js

@@ -509,13 +509,13 @@ function WebGLRenderer( parameters ) {
 
 
 	this.setOpaqueSort = function ( method ) {
 	this.setOpaqueSort = function ( method ) {
 
 
-		opaqueSort = method;
+		opaqueSort = typeof method === 'function' ? method : null;
 
 
 	};
 	};
 
 
 	this.setTransparentSort = function ( method ) {
 	this.setTransparentSort = function ( method ) {
 
 
-		transparentSort = method;
+		transparentSort = typeof method === 'function' ? method : null;
 
 
 	};
 	};
 
 

+ 3 - 3
src/renderers/webgl/WebGLRenderLists.js

@@ -130,10 +130,10 @@ function WebGLRenderList() {
 
 
 	}
 	}
 
 
-	function sort( costumeOpaqueSort, costumeTransparentSort ) {
+	function sort( costumOpaqueSort, costumTransparentSort ) {
 
 
-		if ( opaque.length > 1 ) opaque.sort( typeof costumeOpaqueSort === 'function' ? costumeOpaqueSort : painterSortStable );
-		if ( transparent.length > 1 ) transparent.sort( typeof costumeTransparentSort === 'function' ? costumeTransparentSort : reversePainterSortStable );
+		if ( opaque.length > 1 ) opaque.sort( costumOpaqueSort || painterSortStable );
+		if ( transparent.length > 1 ) transparent.sort( costumTransparentSort || reversePainterSortStable );
 
 
 	}
 	}