Comparing version 1.0.5 to 1.1.0
{ | ||
"name": "polylabel", | ||
"version": "1.0.5", | ||
"version": "1.1.0", | ||
"description": "A JS library for finding optimal label position inside a polygon", | ||
@@ -5,0 +5,0 @@ "main": "polylabel.js", |
@@ -28,3 +28,7 @@ 'use strict'; | ||
if (cellSize === 0) return [minX, minY]; | ||
if (cellSize === 0) { | ||
var degeneratePoleOfInaccessibility = [minX, minY]; | ||
degeneratePoleOfInaccessibility.distance = 0; | ||
return degeneratePoleOfInaccessibility; | ||
} | ||
@@ -77,3 +81,5 @@ // a priority queue of cells in order of their "potential" (max distance to polygon) | ||
return [bestCell.x, bestCell.y]; | ||
var poleOfInaccessibility = [bestCell.x, bestCell.y]; | ||
poleOfInaccessibility.distance = bestCell.d; | ||
return poleOfInaccessibility; | ||
} | ||
@@ -112,3 +118,3 @@ | ||
return (inside ? 1 : -1) * Math.sqrt(minDistSq); | ||
return minDistSq === 0 ? 0 : (inside ? 1 : -1) * Math.sqrt(minDistSq); | ||
} | ||
@@ -115,0 +121,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
15114
128
0