diff --git a/gui/controller.cpp b/gui/controller.cpp index c68e6c3e5b..65a7267f96 100644 --- a/gui/controller.cpp +++ b/gui/controller.cpp @@ -64,13 +64,16 @@ namespace gui { if (m_focusedElement) { - if (!m_focusedElement->hitTest(pt)) + if (!m_LastTapCancelled) { - m_focusedElement->onTapCancelled(pt); - m_LastTapCancelled = true; + if (!m_focusedElement->hitTest(pt)) + { + m_focusedElement->onTapCancelled(pt); + m_LastTapCancelled = true; + } + else + m_focusedElement->onTapMoved(pt); } - else - m_focusedElement->onTapMoved(pt); /// event handled return true; @@ -84,14 +87,16 @@ namespace gui if (m_focusedElement) { // re-checking, whether we are above the gui element. - if (!m_focusedElement->hitTest(pt)) - { - m_focusedElement->onTapCancelled(pt); - m_LastTapCancelled = true; - } - if (!m_LastTapCancelled) - m_focusedElement->onTapEnded(pt); + { + if (!m_focusedElement->hitTest(pt)) + { + m_focusedElement->onTapCancelled(pt); + m_LastTapCancelled = true; + } + else + m_focusedElement->onTapEnded(pt); + } m_focusedElement.reset(); m_LastTapCancelled = false; diff --git a/iphone/Maps/Classes/MapViewController.mm b/iphone/Maps/Classes/MapViewController.mm index c18a8c665c..461d0a969a 100644 --- a/iphone/Maps/Classes/MapViewController.mm +++ b/iphone/Maps/Classes/MapViewController.mm @@ -445,11 +445,16 @@ NSInteger compareAddress(id l, id r, void * context) { // Cancel long-touch timer [NSObject cancelPreviousPerformRequestsWithTarget:self]; - if (tapCount == 1) + + // TapCount could be zero if it was a single long (or moving) tap. + if (tapCount < 2) { if (f.GetGuiController()->OnTapEnded(m_Pt1)) return; + } + if (tapCount == 1) + { // Launch single tap timer if (m_isSticking) [self performSelector:@selector(onSingleTap:) withObject:[NSValue valueWithCGPoint:[theTouch locationInView:self.view]] afterDelay:0.3];