2
0
Эх сурвалжийг харах

Fixed global hl and minor clean up.

Mr.doob 11 жил өмнө
parent
commit
5fe028fda8
1 өөрчлөгдсөн 15 нэмэгдсэн , 5 устгасан
  1. 15 5
      src/extras/core/Shape.js

+ 15 - 5
src/extras/core/Shape.js

@@ -366,12 +366,16 @@ THREE.Shape.Utils = {
 			}
 
 			var holeIndex, shapeIndex,
-				shapePt, h, h2, holePt,
+				shapePt, holePt,
 				holeIdx, cutKey, failedCuts = [],
 				tmpShape1, tmpShape2,
 				tmpHole1, tmpHole2;
 
-			for (h = 0, hl = holes.length; h < hl; h++) { indepHoles.push( h ); }
+			for ( var h = 0, hl = holes.length; h < hl; h ++ ) {
+
+				indepHoles.push( h );
+
+			}
 
 			var counter = indepHoles.length * 2;
 			while ( indepHoles.length > 0 ) {
@@ -389,7 +393,7 @@ THREE.Shape.Utils = {
 					holeIndex	= -1;
 
 					// search for hole which can be reached without intersections
-					for ( h = 0; h < indepHoles.length; h++ ) {
+					for ( var h = 0; h < indepHoles.length; h ++ ) {
 						holeIdx = indepHoles[h];
 
 						// prevent multiple checks
@@ -397,7 +401,7 @@ THREE.Shape.Utils = {
 						if ( failedCuts[cutKey] !== undefined )			continue;
 
 						hole = holes[holeIdx];
-						for ( h2 = 0; h2 < hole.length; h2 ++ ) {
+						for ( var h2 = 0; h2 < hole.length; h2 ++ ) {
 							holePt = hole[ h2 ];
 							if (! isCutLineInsideAngles( shapeIndex, h2 ) )		continue;
 							if ( intersectsShapeEdge( shapePt, holePt ) )		continue;
@@ -437,7 +441,13 @@ THREE.Shape.Utils = {
 		// To maintain reference to old shape, one must match coordinates, or offset the indices from original arrays. It's probably easier to do the first.
 
 		var allpoints = contour.concat();
-		for (var h = 0, hl = holes.length; h < hl; h++) { Array.prototype.push.apply( allpoints, holes[h] ); }
+
+		for ( var h = 0, hl = holes.length; h < hl; h ++ ) {
+
+			Array.prototype.push.apply( allpoints, holes[h] );
+
+		}
+
 		//console.log( "allpoints",allpoints, allpoints.length );
 
 		// prepare all points map