Adapted BoundingBox get_extents(const ExPolygons &expolygons)
to work even with empty polygons.
This commit is contained in:
parent
555560f63c
commit
74b95e9152
1 changed files with 3 additions and 3 deletions
|
@ -553,8 +553,8 @@ BoundingBox get_extents(const ExPolygons &expolygons)
|
||||||
{
|
{
|
||||||
BoundingBox bbox;
|
BoundingBox bbox;
|
||||||
if (! expolygons.empty()) {
|
if (! expolygons.empty()) {
|
||||||
bbox = get_extents(expolygons.front());
|
for (size_t i = 0; i < expolygons.size(); ++ i)
|
||||||
for (size_t i = 1; i < expolygons.size(); ++ i)
|
if (! expolygons[i].contour.points.empty())
|
||||||
bbox.merge(get_extents(expolygons[i]));
|
bbox.merge(get_extents(expolygons[i]));
|
||||||
}
|
}
|
||||||
return bbox;
|
return bbox;
|
||||||
|
|
Loading…
Add table
Reference in a new issue