MCPcopy Create free account
hub / github.com/comaps/comaps / CenterViewport

Method CenterViewport

libs/drape_frontend/navigator.cpp:60–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58}
59
60void Navigator::CenterViewport(m2::PointD const & p)
61{
62 // Rounding center point to a pixel boundary to obtain crisp centered picture.
63 m2::PointD pt = m_Screen.GtoP(p);
64 pt.x = ceil(pt.x);
65 pt.y = ceil(pt.y);
66
67 pt = m_Screen.PtoG(pt);
68
69 m_Screen.SetOrg(pt);
70 if (!m_InAction)
71 m_StartScreen.SetOrg(pt);
72}
73
74void Navigator::OnSize(int w, int h)
75{

Callers

nothing calls this directly

Calls 3

SetOrgMethod · 0.80
GtoPMethod · 0.45
PtoGMethod · 0.45

Tested by

no test coverage detected