[core] Set bucket segments to initialize empty

This commit is contained in:
Bruno de Oliveira Abinader
2016-11-02 15:43:30 +02:00
parent 7534aa1594
commit 549929cefd
11 changed files with 54 additions and 13 deletions

View File

@@ -44,7 +44,7 @@ void CircleBucket::addGeometry(const GeometryCollection& geometryCollection) {
if ((mode != MapMode::Still) &&
(x < 0 || x >= util::EXTENT || y < 0 || y >= util::EXTENT)) continue;
if (segments.back().vertexLength + vertexLength > std::numeric_limits<uint16_t>::max()) {
if (segments.empty() || segments.back().vertexLength + vertexLength > std::numeric_limits<uint16_t>::max()) {
// Move to a new segments because the old one can't hold the geometry.
segments.emplace_back(vertices.size(), triangles.size());
}