diff options
author | ExMix <rahuba.youri@mapswithme.com> | 2014-09-11 15:47:57 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 02:27:06 +0300 |
commit | d66a7d68983bdd13923646322e147daa0acb783f (patch) | |
tree | 3b37029d08d68df626730ba264c6daa2ab2b3125 /qt/draw_widget.cpp | |
parent | 418be3bce3fcdfee027b5ade271742a16cde8a98 (diff) |
[core] add new routing logic
Diffstat (limited to 'qt/draw_widget.cpp')
-rw-r--r-- | qt/draw_widget.cpp | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/qt/draw_widget.cpp b/qt/draw_widget.cpp index 265cfe60ed..5a30dac184 100644 --- a/qt/draw_widget.cpp +++ b/qt/draw_widget.cpp @@ -79,8 +79,7 @@ namespace qt m_isRotate(false), //m_redrawInterval(100), m_ratio(1.0), - m_pScale(0), - m_routingMode(0) + m_pScale(0) { // Initialize with some stubs for test. PinClickManager & manager = GetBalloonManager(); @@ -393,23 +392,10 @@ namespace qt } else if (e->modifiers() & Qt::ShiftModifier) { - m2::PointD const mercPoint = m_framework->PtoG(pt); - - switch (m_routingMode) - { - case 0: - m_framework->SetRouteStart(mercPoint); - break; - case 1: - m_framework->SetRouteEnd(mercPoint); - break; - default: - m_routingMode = -1; - m_framework->DeleteRoutes(); - break; - } - - ++m_routingMode; + if (m_framework->IsRountingActive()) + m_framework->CancelRoutingSession(); + + m_framework->StartRoutingSession(m_framework->PtoG(pt)); } else { |