@dra2020/baseclient 1.0.31 → 1.0.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/baseclient.js +14 -4
- package/dist/baseclient.js.map +1 -1
- package/lib/poly/pointinpoly.ts +15 -4
- package/package.json +1 -1
package/dist/baseclient.js
CHANGED
|
@@ -5884,9 +5884,19 @@ function polyContainsPoint(poly, x, y) {
|
|
|
5884
5884
|
return false;
|
|
5885
5885
|
let bFound = false;
|
|
5886
5886
|
let bInside = false;
|
|
5887
|
+
let iCurPoly = -1;
|
|
5888
|
+
let bCurInside = false;
|
|
5887
5889
|
PP.polyPackEachRing(pp, (b, iPoly, iRing, iOffset, nPoints) => {
|
|
5888
5890
|
if (bFound)
|
|
5889
5891
|
return;
|
|
5892
|
+
if (iRing == 0) {
|
|
5893
|
+
if (iCurPoly >= 0 && bCurInside) {
|
|
5894
|
+
bInside = true;
|
|
5895
|
+
bFound = true;
|
|
5896
|
+
}
|
|
5897
|
+
iCurPoly = iPoly;
|
|
5898
|
+
bCurInside = false;
|
|
5899
|
+
}
|
|
5890
5900
|
let inside = false;
|
|
5891
5901
|
let iEnd = iOffset + (nPoints - 1) * 2;
|
|
5892
5902
|
for (let i = iOffset, j = iEnd; i <= iEnd; j = i, i += 2) {
|
|
@@ -5897,11 +5907,11 @@ function polyContainsPoint(poly, x, y) {
|
|
|
5897
5907
|
if (intersect)
|
|
5898
5908
|
inside = !inside;
|
|
5899
5909
|
}
|
|
5900
|
-
if (inside)
|
|
5901
|
-
|
|
5902
|
-
bInside = iRing == 0; // not inside if inside a hole
|
|
5903
|
-
}
|
|
5910
|
+
if (inside)
|
|
5911
|
+
bCurInside = iRing == 0; // not inside if inside a hole
|
|
5904
5912
|
});
|
|
5913
|
+
if (iCurPoly >= 0 && bCurInside)
|
|
5914
|
+
bInside = true;
|
|
5905
5915
|
return bInside;
|
|
5906
5916
|
}
|
|
5907
5917
|
exports.polyContainsPoint = polyContainsPoint;
|