Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorr.kuznetsov <r.kuznetsov@corp.mail.ru>2017-08-16 10:00:17 +0300
committerDaria Volvenkova <d.volvenkova@corp.mail.ru>2017-08-16 11:42:58 +0300
commit39ef655d53f91b27527bca8b517c0dcaa37ad900 (patch)
treeb05cb0076d9151d55719cb71f43068515c63483d
parent92522e8dc6d03716eecd35735bd00f124fe457a7 (diff)
Fixed route preview on points deletionbeta-965
-rw-r--r--drape_frontend/route_renderer.cpp3
-rw-r--r--iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/RoutePreview/RouteManager/RouteManagerViewModel.swift3
-rw-r--r--iphone/Maps/Core/Routing/MWMRouter+RouteManager.mm9
-rw-r--r--iphone/Maps/Core/Routing/MWMRouter.h1
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