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
path: root/map
diff options
context:
space:
mode:
authorr.kuznetsov <r.kuznetsov@corp.mail.ru>2016-06-09 13:12:54 +0300
committerVladimir Byko-Ianko <v.bykoianko@corp.mail.ru>2016-06-23 19:23:38 +0300
commit389a5cef873b809b72e93b0216c91ec0d4fddcf3 (patch)
tree1e1b5a6f0befcebb07772c83e14c5a64cf5c2b6a /map
parent88244ee326746469fa12f3301aff2f1466fc61ac (diff)
Added small route validation
Diffstat (limited to 'map')
-rw-r--r--map/framework.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/map/framework.cpp b/map/framework.cpp
index 64b0c0ac57..7daaf957b8 100644
--- a/map/framework.cpp
+++ b/map/framework.cpp
@@ -2231,9 +2231,15 @@ void Framework::BuildRoute(m2::PointD const & start, m2::PointD const & finish,
InsertRoute(route);
StopLocationFollow();
- m2::RectD routeRect = route.GetPoly().GetLimitRect();
- routeRect.Scale(kRouteScaleMultiplier);
- ShowRect(routeRect, -1);
+
+ // Validate route (in case of bicycle routing it can be invalid).
+ ASSERT(route.IsValid(), ());
+ if (route.IsValid())
+ {
+ m2::RectD routeRect = route.GetPoly().GetLimitRect();
+ routeRect.Scale(kRouteScaleMultiplier);
+ ShowRect(routeRect, -1);
+ }
}
else
{