@math.gl/polygon
Advanced tools
Comparing version 3.3.1 to 3.3.2
@@ -73,2 +73,10 @@ "use strict"; | ||
function concatInPlace(arr1, arr2) { | ||
for (var i = 0; i < arr2.length; i++) { | ||
arr1.push(arr2[i]); | ||
} | ||
return arr1; | ||
} | ||
function cutPolygonByGrid(positions, holeIndices) { | ||
@@ -127,6 +135,6 @@ var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; | ||
polygonLow.holes.push(polygonLow.pos.length); | ||
polygonLow.pos = polygonLow.pos.concat(parts[0].pos); | ||
polygonLow.pos = concatInPlace(polygonLow.pos, parts[0].pos); | ||
if (edgeTypes) { | ||
polygonLow.types = polygonLow.types.concat(parts[0].types); | ||
polygonLow.types = concatInPlace(polygonLow.types, parts[0].types); | ||
} | ||
@@ -137,6 +145,6 @@ } | ||
polygonHigh.holes.push(polygonHigh.pos.length); | ||
polygonHigh.pos = polygonHigh.pos.concat(parts[1].pos); | ||
polygonHigh.pos = concatInPlace(polygonHigh.pos, parts[1].pos); | ||
if (edgeTypes) { | ||
polygonHigh.types = polygonHigh.types.concat(parts[1].types); | ||
polygonHigh.types = concatInPlace(polygonHigh.types, parts[1].types); | ||
} | ||
@@ -143,0 +151,0 @@ } |
@@ -56,2 +56,11 @@ import { bitCode, intersect } from './lineclip'; | ||
const TYPE_BORDER = 1; | ||
function concatInPlace(arr1, arr2) { | ||
for (let i = 0; i < arr2.length; i++) { | ||
arr1.push(arr2[i]); | ||
} | ||
return arr1; | ||
} | ||
export function cutPolygonByGrid(positions, holeIndices, options = {}) { | ||
@@ -106,6 +115,6 @@ if (!positions.length) { | ||
polygonLow.holes.push(polygonLow.pos.length); | ||
polygonLow.pos = polygonLow.pos.concat(parts[0].pos); | ||
polygonLow.pos = concatInPlace(polygonLow.pos, parts[0].pos); | ||
if (edgeTypes) { | ||
polygonLow.types = polygonLow.types.concat(parts[0].types); | ||
polygonLow.types = concatInPlace(polygonLow.types, parts[0].types); | ||
} | ||
@@ -116,6 +125,6 @@ } | ||
polygonHigh.holes.push(polygonHigh.pos.length); | ||
polygonHigh.pos = polygonHigh.pos.concat(parts[1].pos); | ||
polygonHigh.pos = concatInPlace(polygonHigh.pos, parts[1].pos); | ||
if (edgeTypes) { | ||
polygonHigh.types = polygonHigh.types.concat(parts[1].types); | ||
polygonHigh.types = concatInPlace(polygonHigh.types, parts[1].types); | ||
} | ||
@@ -122,0 +131,0 @@ } |
@@ -61,2 +61,11 @@ import { bitCode, intersect } from './lineclip'; | ||
var TYPE_BORDER = 1; | ||
function concatInPlace(arr1, arr2) { | ||
for (var i = 0; i < arr2.length; i++) { | ||
arr1.push(arr2[i]); | ||
} | ||
return arr1; | ||
} | ||
export function cutPolygonByGrid(positions, holeIndices) { | ||
@@ -115,6 +124,6 @@ var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; | ||
polygonLow.holes.push(polygonLow.pos.length); | ||
polygonLow.pos = polygonLow.pos.concat(parts[0].pos); | ||
polygonLow.pos = concatInPlace(polygonLow.pos, parts[0].pos); | ||
if (edgeTypes) { | ||
polygonLow.types = polygonLow.types.concat(parts[0].types); | ||
polygonLow.types = concatInPlace(polygonLow.types, parts[0].types); | ||
} | ||
@@ -125,6 +134,6 @@ } | ||
polygonHigh.holes.push(polygonHigh.pos.length); | ||
polygonHigh.pos = polygonHigh.pos.concat(parts[1].pos); | ||
polygonHigh.pos = concatInPlace(polygonHigh.pos, parts[1].pos); | ||
if (edgeTypes) { | ||
polygonHigh.types = polygonHigh.types.concat(parts[1].types); | ||
polygonHigh.types = concatInPlace(polygonHigh.types, parts[1].types); | ||
} | ||
@@ -131,0 +140,0 @@ } |
@@ -8,3 +8,3 @@ { | ||
}, | ||
"version": "3.3.1", | ||
"version": "3.3.2", | ||
"keywords": [ | ||
@@ -29,5 +29,5 @@ "webgl", | ||
"dependencies": { | ||
"@math.gl/core": "3.3.1" | ||
"@math.gl/core": "3.3.2" | ||
}, | ||
"gitHead": "affaa0dcec01948f764e1cee4a68c5e84bc52b29" | ||
"gitHead": "7888ec8b0b010bf322c3da09b120cfe563a52be9" | ||
} |
@@ -60,2 +60,9 @@ /* eslint-disable max-statements, max-depth, complexity, no-unused-expressions */ | ||
function concatInPlace(arr1, arr2) { | ||
for (let i = 0; i < arr2.length; i++) { | ||
arr1.push(arr2[i]); | ||
} | ||
return arr1; | ||
} | ||
export function cutPolygonByGrid(positions, holeIndices, options = {}) { | ||
@@ -100,5 +107,5 @@ if (!positions.length) { | ||
polygonLow.holes.push(polygonLow.pos.length); | ||
polygonLow.pos = polygonLow.pos.concat(parts[0].pos); | ||
polygonLow.pos = concatInPlace(polygonLow.pos, parts[0].pos); | ||
if (edgeTypes) { | ||
polygonLow.types = polygonLow.types.concat(parts[0].types); | ||
polygonLow.types = concatInPlace(polygonLow.types, parts[0].types); | ||
} | ||
@@ -108,5 +115,5 @@ } | ||
polygonHigh.holes.push(polygonHigh.pos.length); | ||
polygonHigh.pos = polygonHigh.pos.concat(parts[1].pos); | ||
polygonHigh.pos = concatInPlace(polygonHigh.pos, parts[1].pos); | ||
if (edgeTypes) { | ||
polygonHigh.types = polygonHigh.types.concat(parts[1].types); | ||
polygonHigh.types = concatInPlace(polygonHigh.types, parts[1].types); | ||
} | ||
@@ -113,0 +120,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
228462
2583
+ Added@math.gl/core@3.3.2(transitive)
- Removed@math.gl/core@3.3.1(transitive)
Updated@math.gl/core@3.3.2