Fixed route preview on points deletion

This commit is contained in:
r.kuznetsov 2017-08-16 10:00:17 +03:00 committed by Vladimir Byko-Ianko
parent a9cb5fef52
commit 306cb2ab76
4 changed files with 12 additions and 4 deletions

View file

@ -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;
}

View file

@ -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()
}
}

View file

@ -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

View file

@ -60,5 +60,6 @@ typedef void (^MWMImageHeightBlock)(UIImage *, NSString *);
+ (void)applyRouteManagerTransaction;
+ (void)cancelRouteManagerTransaction;
+ (void)movePointAtIndex:(NSInteger)index toIndex:(NSInteger)newIndex;
+ (void)updatePreviewMode;
@end