Pārlūkot izejas kodu

fix misspelled and typeof only once

ranbuch 6 gadi atpakaļ
vecāks
revīzija
f70a3e4efb

+ 2 - 2
src/renderers/WebGLRenderer.js

@@ -509,13 +509,13 @@ function WebGLRenderer( parameters ) {
 
 	this.setOpaqueSort = function ( method ) {
 
-		opaqueSort = method;
+		opaqueSort = typeof method === 'function' ? method : null;
 
 	};
 
 	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 );
 
 	}