[search] Fix bug with viewport for results without name.

This commit is contained in:
vng 2012-03-03 00:46:17 +03:00 committed by Alex Zolotarev
parent 6c3eed2dd7
commit 23383beb86

View file

@ -54,8 +54,13 @@ public:
void CorrectScaleForVisibility(TypesHolder const & types, int & scale) const
{
pair<int, int> const scaleR = feature::DrawableScaleRangeForText(types);
if (scale < scaleR.first || scale > scaleR.second)
scale = scaleR.first;
// Result types can be without visible texts (matched by category).
if (scaleR.first != -1)
{
if (scale < scaleR.first || scale > scaleR.second)
scale = scaleR.first;
}
}
m2::RectD CorrectRectForScales(TypesHolder const & types, m2::RectD const & rect) const