Adapted BoundingBox get_extents(const ExPolygons &expolygons)

to work even with empty polygons.
This commit is contained in:
bubnikv 2017-04-05 09:52:06 +02:00
parent 555560f63c
commit 74b95e9152

View File

@ -553,9 +553,9 @@ BoundingBox get_extents(const ExPolygons &expolygons)
{
BoundingBox bbox;
if (! expolygons.empty()) {
bbox = get_extents(expolygons.front());
for (size_t i = 1; i < expolygons.size(); ++ i)
bbox.merge(get_extents(expolygons[i]));
for (size_t i = 0; i < expolygons.size(); ++ i)
if (! expolygons[i].contour.points.empty())
bbox.merge(get_extents(expolygons[i]));
}
return bbox;
}