mirror of
https://github.com/mapbox/tippecanoe.git
synced 2025-04-09 03:54:13 +00:00
Fix clipping of polygons with multiple rings.
This commit is contained in:
parent
3bdcc3ca90
commit
151f0c116c
10
tile.cc
10
tile.cc
@ -487,7 +487,7 @@ drawvec clip_poly(drawvec &geom, int z, int detail) {
|
||||
if (geom[i].op == VT_MOVETO) {
|
||||
unsigned j;
|
||||
for (j = i + 1; j < geom.size(); j++) {
|
||||
if (geom[j].op == VT_CLOSEPATH) {
|
||||
if (geom[j].op == VT_CLOSEPATH || geom[j].op == VT_MOVETO) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -501,8 +501,12 @@ drawvec clip_poly(drawvec &geom, int z, int detail) {
|
||||
out.push_back(tmp[k]);
|
||||
}
|
||||
|
||||
out.push_back(draw(VT_CLOSEPATH, 0, 0));
|
||||
i = j;
|
||||
if (j >= geom.size() || geom[j].op == VT_CLOSEPATH) {
|
||||
out.push_back(draw(VT_CLOSEPATH, 0, 0));
|
||||
i = j;
|
||||
} else {
|
||||
i = j - 1;
|
||||
}
|
||||
} else {
|
||||
out.push_back(geom[i]);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user