From df2bd863b6c8b8b491565e1f0e622c82d7c14150 Mon Sep 17 00:00:00 2001 From: Siarhei Rachytski Date: Mon, 1 Oct 2012 12:54:47 +0300 Subject: [PATCH] in case of animation the m_focusedElement could "sneak" away of the touch, so we should check this in onTapEnded. --- gui/controller.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gui/controller.cpp b/gui/controller.cpp index 6c6d44321a..c68e6c3e5b 100644 --- a/gui/controller.cpp +++ b/gui/controller.cpp @@ -83,6 +83,13 @@ 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);