diff --git a/include/mapbox/earcut.hpp b/include/mapbox/earcut.hpp index 8a4eeac..25c461b 100644 --- a/include/mapbox/earcut.hpp +++ b/include/mapbox/earcut.hpp @@ -521,10 +521,7 @@ Earcut::findHoleBridge(Node* hole, Node* outerNode) { // whether sector in vertex m contains sector in vertex p in the same coordinates template bool Earcut::sectorContainsSector(const Node* m, const Node* p) { - return ( - (area(m->prev, m, p->prev) < 0 || area(p->prev, m, m->next) < 0) && - (area(m->prev, m, p->next) < 0 || area(p->next, m, m->next) < 0) - ); + return area(m->prev, m, p->prev) < 0 && area(p->next, m, m->next) < 0; } // interlink polygon nodes in z-order diff --git a/test/convert_tests.js b/test/convert_tests.js index cc3b251..2bf2b4a 100644 --- a/test/convert_tests.js +++ b/test/convert_tests.js @@ -60,7 +60,8 @@ fs.readdirSync(base).filter(function (name) { "empty_square": Infinity, "issue83": Infinity, "issue107": Infinity, - "issue119": 0.04 + "issue119": 0.04, + "touching4": 0.06 }; var expectedLibtessDeviation = libtessDeviationMap[id]; if (!expectedLibtessDeviation) expectedLibtessDeviation = 0.000001; diff --git a/test/fixtures/touching4.cpp b/test/fixtures/touching4.cpp new file mode 100644 index 0000000..ca6420a --- /dev/null +++ b/test/fixtures/touching4.cpp @@ -0,0 +1,17 @@ +// This file is auto-generated, manual changes will be lost if the code is regenerated. + +#include "geometries.hpp" + +namespace mapbox { +namespace fixtures { + +static const Fixture touching4("touching4", 20, 1e-14, 0.06, { + {{11,10},{0,10},{0,0},{11,0}}, + {{7,6},{7,9},{10,9}}, + {{7,5},{10,2},{10,5}}, + {{6,9},{1,4},{1,9}}, + {{1,1},{1,4},{4,1}}, +}); + +} +}