[search] Do not show "Empty model message" when there are no features to draw, but country under screen center is loaded.

This commit is contained in:
vng 2012-03-12 19:29:26 +03:00 committed by Alex Zolotarev
parent 15e0cc25f4
commit fdab92988c
2 changed files with 9 additions and 3 deletions

View file

@ -352,11 +352,14 @@ void Framework::DrawModel(shared_ptr<PaintEvent> const & e,
bool Framework::IsEmptyModel(m2::PointD const & pt)
{
/*
string const fName = GetSearchEngine()->GetCountryFile(pt);
if (fName.empty())
return false;
return !m_model.IsLoaded(fName);
*/
return !m_model.IsCountryLoaded(pt);
}
void Framework::BeginPaint(shared_ptr<PaintEvent> const & e)
@ -762,8 +765,8 @@ void Framework::SetRenderPolicy(RenderPolicy * renderPolicy)
if (m_renderPolicy.get())
{
m_renderPolicy->SetRenderFn(DrawModelFn());
m_renderPolicy->SetEmptyModelFn(bind(&Framework::IsEmptyModel, this, _1));
m_renderPolicy->SetRenderFn(DrawModelFn());
m_navigator.SetSupportRotation(m_renderPolicy->DoSupportRotation());

View file

@ -464,8 +464,11 @@ void RenderQueueRoutine::Do()
break;
/// if something were actually drawn, or (exclusive or) we are repainting the whole rect
if ((!cumulativeEmptyModelCurrent) || (fullRectRepaint))
m_renderState->m_isEmptyModelActual = cumulativeEmptyModelCurrent;
if (!cumulativeEmptyModelCurrent || fullRectRepaint)
{
m_renderState->m_isEmptyModelActual = cumulativeEmptyModelCurrent &&
m_emptyModelFn(m_currentRenderCommand->m_frameScreen.GlobalRect().GetGlobalRect().Center());
}
/// setting the "whole texture" clip rect to render texts opened by panning.
m_threadDrawer->screen()->setClipRect(textureRect);