| 105 | } |
| 106 | |
| 107 | void Navigator::DoDrag(m2::PointD const & pt) |
| 108 | { |
| 109 | if (m_LastPt1 == pt) |
| 110 | return; |
| 111 | |
| 112 | ScreenBase const s = ShrinkInto(m_StartScreen, df::GetWorldRect()); |
| 113 | |
| 114 | double dx = pt.x - m_StartPt1.x; |
| 115 | double dy = pt.y - m_StartPt1.y; |
| 116 | |
| 117 | ScreenBase tmp = s; |
| 118 | tmp.Move(dx, 0); |
| 119 | if (!CheckBorders(tmp)) |
| 120 | dx = 0; |
| 121 | |
| 122 | tmp = s; |
| 123 | tmp.Move(0, dy); |
| 124 | if (!CheckBorders(tmp)) |
| 125 | dy = 0; |
| 126 | |
| 127 | tmp = s; |
| 128 | tmp.Move(dx, dy); |
| 129 | |
| 130 | if (CheckBorders(tmp)) |
| 131 | { |
| 132 | m_StartScreen = tmp; |
| 133 | m_StartPt1 = pt; |
| 134 | m_LastPt1 = pt; |
| 135 | m_Screen = tmp; |
| 136 | } |
| 137 | } |
| 138 | |
| 139 | void Navigator::StopDrag(m2::PointD const & pt) |
| 140 | { |
no test coverage detected