Skip to content

Commit

Permalink
Fixed order of computeFields recomputations; fixes #124 (#125)
Browse files Browse the repository at this point in the history
Co-authored-by: Alexander Milevski <[email protected]>
  • Loading branch information
bluenote10 and w8r authored Mar 2, 2022
1 parent 3b85d7a commit 2954c4b
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/subdivide_segments.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default function subdivide(eventQueue, subject, clipping, sbbox, cbbox, o
if (next) {
if (possibleIntersection(event, next.key, eventQueue) === 2) {
computeFields(event, prevEvent, operation);
computeFields(event, next.key, operation);
computeFields(next.key, event, operation);
}
}

Expand Down
32 changes: 32 additions & 0 deletions test/genericTestCases/issue124.geojson
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"features": [
{
"geometry": {
"coordinates": [[[0, 10], [0, -10], [30, -10], [30, 10], [0, 10]]],
"type": "Polygon"
},
"properties": {},
"type": "Feature"
},
{
"geometry": {
"coordinates": [[[10, 10], [10, -10], [20, -10], [20, 10], [10, 10]]],
"type": "Polygon"
},
"properties": {},
"type": "Feature"
},
{
"geometry": {
"coordinates": [
[[[0, -10], [10, -10], [10, 10], [0, 10], [0, -10]]],
[[[20, -10], [30, -10], [30, 10], [20, 10], [20, -10]]]
],
"type": "MultiPolygon"
},
"properties": {"operation": "diff"},
"type": "Feature"
}
],
"type": "FeatureCollection"
}

0 comments on commit 2954c4b

Please sign in to comment.