diff options
author | rachytski <siarhei.rachytski@gmail.com> | 2012-10-23 23:51:27 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 01:46:09 +0300 |
commit | 238e410aded7a36c90511d50c5f9cdad98a3d727 (patch) | |
tree | 74106cd5d7c5620d2b01531f897c25b381a9ed42 /gui | |
parent | ed51c2a859d577aa7f3599cf0c7d939fd7b15722 (diff) |
fixed processing of GUI elements.
Diffstat (limited to 'gui')
-rw-r--r-- | gui/controller.cpp | 27 |
1 files changed, 16 insertions, 11 deletions
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,15 +87,17 @@ namespace gui if (m_focusedElement) { // re-checking, whether we are above the gui element. - 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->onTapEnded(pt); } - if (!m_LastTapCancelled) - m_focusedElement->onTapEnded(pt); - m_focusedElement.reset(); m_LastTapCancelled = false; |