| 279 | } |
| 280 | |
| 281 | void RouteRenderer::CacheRouteArrows(ScreenBase const & screen, dp::DrapeID subrouteId, |
| 282 | std::vector<ArrowBorders> && arrowBorders, |
| 283 | CacheRouteArrowsCallback const & cacheCallback) |
| 284 | { |
| 285 | ASSERT(cacheCallback != nullptr, ()); |
| 286 | auto const it = FindSubroute(m_subroutes, subrouteId); |
| 287 | if (it == m_subroutes.end()) |
| 288 | return; |
| 289 | |
| 290 | auto & subrouteInfo = *it; |
| 291 | |
| 292 | double zoom = 0.0; |
| 293 | float halfWidth = 0.0; |
| 294 | InterpolateByZoom(subrouteInfo.m_subroute, screen, halfWidth, zoom); |
| 295 | |
| 296 | if (arrowBorders.empty() || zoom < kArrowAppearingZoomLevel) |
| 297 | { |
| 298 | // Clear arrows. |
| 299 | subrouteInfo.m_arrowsData.reset(); |
| 300 | subrouteInfo.m_arrowBorders.clear(); |
| 301 | } |
| 302 | else if (!AreEqualArrowBorders(arrowBorders, subrouteInfo.m_arrowBorders)) |
| 303 | { |
| 304 | subrouteInfo.m_arrowBorders = std::move(arrowBorders); |
| 305 | cacheCallback(subrouteInfo.m_subrouteId, subrouteInfo.m_arrowBorders); |
| 306 | } |
| 307 | } |
| 308 | |
| 309 | void RouteRenderer::UpdatePreview(ScreenBase const & screen) |
| 310 | { |
nothing calls this directly
no test coverage detected