| 58 | } |
| 59 | |
| 60 | void 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 | |
| 74 | void Navigator::OnSize(int w, int h) |
| 75 | { |