From ff23c44179a82db4e95e3ca139479a43fda94497 Mon Sep 17 00:00:00 2001 From: zz85 Date: Wed, 4 Jan 2012 19:39:43 +0800 Subject: [PATCH] fix Path.js again --- src/extras/core/Path.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/extras/core/Path.js b/src/extras/core/Path.js index 4fe3de8b33..4a89a5e9fc 100644 --- a/src/extras/core/Path.js +++ b/src/extras/core/Path.js @@ -330,7 +330,6 @@ THREE.Path.prototype.getPoints = function( divisions, closedPath ) { var deltaAngle = aEndAngle - aStartAngle; var angle; var tdivisions = divisions * 2; - var t; for ( j = 1; j <= tdivisions; j ++ ) { @@ -558,21 +557,20 @@ THREE.Path.prototype.toShapes = function() { if ( subPaths.length == 0 ) return []; + var tmpPath, tmpShape, shapes = []; + var holesFirst = !THREE.Shape.Utils.isClockWise( subPaths[ 0 ].getPoints() ); + // console.log("Holes first", holesFirst); + if ( subPaths.length == 1) { tmpPath = subPaths[0]; tmpShape = new THREE.Shape(); tmpShape.actions = tmpPath.actions; tmpShape.curves = tmpPath.curves; - return tmpShape; + shapes.push( tmpShape ); + return shapes; }; - var tmpPath, tmpShape, shapes = []; - - // console.log("Holes first", holesFirst); - - - if ( holesFirst ) { tmpShape = new THREE.Shape(); -- GitLab