From 39ef655d53f91b27527bca8b517c0dcaa37ad900 Mon Sep 17 00:00:00 2001 From: "r.kuznetsov" Date: Wed, 16 Aug 2017 10:00:17 +0300 Subject: Fixed route preview on points deletion --- drape_frontend/route_renderer.cpp | 3 ++- .../Views/RoutePreview/RouteManager/RouteManagerViewModel.swift | 3 +++ iphone/Maps/Core/Routing/MWMRouter+RouteManager.mm | 9 ++++++--- iphone/Maps/Core/Routing/MWMRouter.h | 1 + 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/drape_frontend/route_renderer.cpp b/drape_frontend/route_renderer.cpp index f8592eb9b3..f0cd20fde7 100644 --- a/drape_frontend/route_renderer.cpp +++ b/drape_frontend/route_renderer.cpp @@ -452,7 +452,8 @@ void RouteRenderer::RenderRouteArrowData(dp::DrapeID subrouteId, RouteAdditional dp::UniformValuesStorage const & commonUniforms) { if (routeAdditional.m_arrowsData == nullptr || - routeAdditional.m_arrowsData->m_renderProperty.m_buckets.empty()) + routeAdditional.m_arrowsData->m_renderProperty.m_buckets.empty() || + m_hiddenSubroutes.find(subrouteId) != m_hiddenSubroutes.end()) { return; } diff --git a/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/RoutePreview/RouteManager/RouteManagerViewModel.swift b/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/RoutePreview/RouteManager/RouteManagerViewModel.swift index c4c60f4545..d2a9c4d01c 100644 --- a/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/RoutePreview/RouteManager/RouteManagerViewModel.swift +++ b/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/RoutePreview/RouteManager/RouteManagerViewModel.swift @@ -14,14 +14,17 @@ final class RouteManagerViewModel: NSObject, RouteManagerViewModelProtocol { func addLocationPoint() { MWMRouter.addPoint(MWMRoutePoint(lastLocationAndType: .start, intermediateIndex: 0)) + MWMRouter.updatePreviewMode() refreshControlsCallback() } func movePoint(at index: Int, to newIndex: Int) { MWMRouter.movePoint(at: index, to: newIndex) + MWMRouter.updatePreviewMode() refreshControlsCallback() } func deletePoint(at index: Int) { MWMRouter.removePoint(routePoints[index]) + MWMRouter.updatePreviewMode() refreshControlsCallback() } } diff --git a/iphone/Maps/Core/Routing/MWMRouter+RouteManager.mm b/iphone/Maps/Core/Routing/MWMRouter+RouteManager.mm index 79cc6c93da..4ccbb7e2f1 100644 --- a/iphone/Maps/Core/Routing/MWMRouter+RouteManager.mm +++ b/iphone/Maps/Core/Routing/MWMRouter+RouteManager.mm @@ -42,9 +42,12 @@ + (void)movePointAtIndex:(NSInteger)index toIndex:(NSInteger)newIndex { NSAssert(index != newIndex, @"Route manager moves point to its' current position."); - auto & rm = GetFramework().GetRoutingManager(); - rm.MoveRoutePoint(index, newIndex); - rm.UpdatePreviewMode(); + GetFramework().GetRoutingManager().MoveRoutePoint(index, newIndex); +} + ++ (void)updatePreviewMode +{ + GetFramework().GetRoutingManager().UpdatePreviewMode(); } @end diff --git a/iphone/Maps/Core/Routing/MWMRouter.h b/iphone/Maps/Core/Routing/MWMRouter.h index fd9749fb3e..a9015e6451 100644 --- a/iphone/Maps/Core/Routing/MWMRouter.h +++ b/iphone/Maps/Core/Routing/MWMRouter.h @@ -60,5 +60,6 @@ typedef void (^MWMImageHeightBlock)(UIImage *, NSString *); + (void)applyRouteManagerTransaction; + (void)cancelRouteManagerTransaction; + (void)movePointAtIndex:(NSInteger)index toIndex:(NSInteger)newIndex; ++ (void)updatePreviewMode; @end -- cgit v1.2.3