| 282 | } |
| 283 | |
| 284 | void Framework::OnViewportChanged(ScreenBase const & screen) |
| 285 | { |
| 286 | // Drape engine may spuriously call OnViewportChanged. Filter out the calls that |
| 287 | // change the viewport from the drape engine's point of view but leave it almost |
| 288 | // the same from the point of view of the framework and all its subsystems such as search api. |
| 289 | // Additional filtering may be done by each subsystem. |
| 290 | auto const isSameViewport = |
| 291 | m2::IsEqual(screen.ClipRect(), m_currentModelView.ClipRect(), kMwmPointAccuracy, kMwmPointAccuracy); |
| 292 | if (isSameViewport) |
| 293 | return; |
| 294 | |
| 295 | m_currentModelView = screen; |
| 296 | |
| 297 | GetSearchAPI().OnViewportChanged(GetCurrentViewport()); |
| 298 | |
| 299 | GetBookmarkManager().UpdateViewport(m_currentModelView); |
| 300 | m_trafficManager.UpdateViewport(m_currentModelView); |
| 301 | m_transitManager.UpdateViewport(m_currentModelView); |
| 302 | m_isolinesManager.UpdateViewport(m_currentModelView); |
| 303 | |
| 304 | if (m_viewportChangedFn != nullptr) |
| 305 | m_viewportChangedFn(screen); |
| 306 | } |
| 307 | |
| 308 | Framework::Framework(FrameworkParams const & params, bool loadMaps) |
| 309 | : m_enabledDiffs(params.m_enableDiffs) |