瀏覽代碼

Merge branch 'pathholes2' of https://github.com/jahting/three.js into dev

Mr.doob 11 年之前
父節點
當前提交
b70137f807
共有 1 個文件被更改,包括 4 次插入6 次删除
  1. 4 6
      src/extras/core/Path.js

+ 4 - 6
src/extras/core/Path.js

@@ -491,15 +491,13 @@ THREE.Path.prototype.toShapes = function( isCCW, noHoles ) {
 
 
 	function toShapesNoHoles( inSubpaths ) {
 	function toShapesNoHoles( inSubpaths ) {
 
 
-		var i, il;
-		var tmpPath, tmpShape;
 		var shapes = [];
 		var shapes = [];
 
 
-		for ( i = 0, il = inSubpaths.length; i < il; i ++ ) {
+		for ( var i = 0, il = inSubpaths.length; i < il; i ++ ) {
 
 
-			tmpPath = inSubpaths[ i ];
+			var tmpPath = inSubpaths[ i ];
 
 
-			tmpShape = new THREE.Shape();
+			var tmpShape = new THREE.Shape();
 			tmpShape.actions = tmpPath.actions;
 			tmpShape.actions = tmpPath.actions;
 			tmpShape.curves = tmpPath.curves;
 			tmpShape.curves = tmpPath.curves;
 
 
@@ -560,7 +558,7 @@ THREE.Path.prototype.toShapes = function( isCCW, noHoles ) {
 	var subPaths = extractSubpaths( this.actions );
 	var subPaths = extractSubpaths( this.actions );
 	if ( subPaths.length == 0 ) return [];
 	if ( subPaths.length == 0 ) return [];
 
 
-	if ( noHoles )	return	toShapesNoHoles( subPaths );
+	if ( noHoles === true )	return	toShapesNoHoles( subPaths );
 
 
 
 
 	var solid, tmpPath, tmpShape, shapes = [];
 	var solid, tmpPath, tmpShape, shapes = [];