diff --git a/src/mbgl/text/collision_feature.cpp b/src/mbgl/text/collision_feature.cpp index f44e48c35..181875139 100644 --- a/src/mbgl/text/collision_feature.cpp +++ b/src/mbgl/text/collision_feature.cpp @@ -15,9 +15,13 @@ CollisionFeature::CollisionFeature(const std::vector &line, const An const float x2 = right * boxScale + padding; if (alongLine) { - const float height = y2 - y1; + float height = y2 - y1; const float length = x2 - x1; + if (height <= 0.0f) return; + + height = std::max(10.0f * boxScale, height); + bboxifyLabel(line, anchor, length, height); } else { boxes.emplace_back(anchor, x1, y1, x2, y2, std::numeric_limits::infinity());