diff --git a/Gruntfile.js b/Gruntfile.js index 9e7b7a8..16f5ea9 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -9,6 +9,8 @@ module.exports = function(grunt) { globals: {} }, all: [ + 'src/parseColor.js', + 'lib/earcut.custom.js', 'src/vec2.js', 'src/vec3.js', 'src/split.js', diff --git a/dist/Triangulate.js b/dist/Triangulate.js index ee225ec..f68c1b5 100644 --- a/dist/Triangulate.js +++ b/dist/Triangulate.js @@ -150,7 +150,7 @@ var w3cColors = { yellowgreen: '#9acd32' }; -var parseColor = exports = function(str) { +function parseColor(str) { str = str || ''; str = str.toLowerCase(); str = w3cColors[str] || str; @@ -168,9 +168,9 @@ var parseColor = exports = function(str) { parseInt(m[1], 10)/255, parseInt(m[2], 10)/255, parseInt(m[3], 10)/255 - ] + ]; } -}; +} var earcut = (function() { @@ -765,10 +765,11 @@ var earcut = (function() { earcut.deviation = function(data, holeIndices, dim, triangles) { var hasHoles = holeIndices && holeIndices.length; var outerLen = hasHoles ? holeIndices[0]*dim : data.length; + var i, len; var polygonArea = Math.abs(signedArea(data, 0, outerLen, dim)); if (hasHoles) { - for (var i = 0, len = holeIndices.length; i