forked from organicmaps/organicmaps
Fix possible bug - sizes should be assigned to Navigator before Framework::ShowRect call.
Make similar logic for render initializing in yopme, qt, android.
This commit is contained in:
parent
659543cc18
commit
6f61d925d6
3 changed files with 14 additions and 25 deletions
|
@ -26,9 +26,10 @@ namespace yopme
|
|||
: m_width(width)
|
||||
, m_height(height)
|
||||
{
|
||||
// TODO move this in some method like ExternalStorageConnected
|
||||
m_framework.AddLocalMaps();
|
||||
m_framework.LoadBookmarks();
|
||||
m_framework.OnSize(width, height);
|
||||
|
||||
OnMapFileUpdate();
|
||||
OnKmlFileUpdate();
|
||||
}
|
||||
|
||||
Framework::~Framework()
|
||||
|
@ -82,19 +83,12 @@ namespace yopme
|
|||
rpParams.m_screenWidth = m_width;
|
||||
rpParams.m_screenHeight = m_height;
|
||||
|
||||
try
|
||||
{
|
||||
YopmeRP * rp = new YopmeRP(rpParams);
|
||||
m_framework.SetRenderPolicy(rp);
|
||||
m_framework.InitGuiSubsystem();
|
||||
m_framework.OnSize(m_width, m_height);
|
||||
rp->SetDrawingApiPin(needApiPin, m_framework.GtoP(apiPinPoint));
|
||||
rp->SetDrawingMyLocation(needMyLoc, m_framework.GtoP(myLocPoint));
|
||||
}
|
||||
catch(RootException & e)
|
||||
{
|
||||
LOG(LERROR, (e.what()));
|
||||
}
|
||||
YopmeRP * rp = new YopmeRP(rpParams);
|
||||
m_framework.SetRenderPolicy(rp);
|
||||
m_framework.InitGuiSubsystem();
|
||||
|
||||
rp->SetDrawingApiPin(needApiPin, m_framework.GtoP(apiPinPoint));
|
||||
rp->SetDrawingMyLocation(needMyLoc, m_framework.GtoP(myLocPoint));
|
||||
}
|
||||
|
||||
void Framework::TeardownRenderPolicy()
|
||||
|
|
|
@ -682,17 +682,15 @@ void Framework::OnSize(int w, int h)
|
|||
if (w < 2) w = 2;
|
||||
if (h < 2) h = 2;
|
||||
|
||||
m_navigator.OnSize(0, 0, w, h);
|
||||
|
||||
if (m_renderPolicy)
|
||||
{
|
||||
m_informationDisplay.setDisplayRect(m2::RectI(0, 0, w, h));
|
||||
|
||||
m_renderPolicy->OnSize(w, h);
|
||||
|
||||
m_navigator.OnSize(0, 0, w, h);
|
||||
|
||||
m_balloonManager.ScreenSizeChanged(w, h);
|
||||
|
||||
m_scales.SetParams(m_renderPolicy->VisualScale(), m_renderPolicy->TileSize());
|
||||
}
|
||||
|
||||
m_width = w;
|
||||
|
@ -1320,6 +1318,8 @@ void Framework::SetRenderPolicy(RenderPolicy * renderPolicy)
|
|||
|
||||
m_renderPolicy->SetRenderFn(DrawModelFn());
|
||||
|
||||
m_scales.SetParams(m_renderPolicy->VisualScale(), m_renderPolicy->TileSize());
|
||||
|
||||
if (m_benchmarkEngine)
|
||||
m_benchmarkEngine->Start();
|
||||
}
|
||||
|
|
|
@ -282,11 +282,6 @@ namespace qt
|
|||
/// @todo Show "Please Update Drivers" dialog and close the program.
|
||||
}
|
||||
|
||||
catch (RootException const & e)
|
||||
{
|
||||
LOG(LERROR, (e.what()));
|
||||
}
|
||||
|
||||
m_isInitialized = true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue