diff --git a/include/GUIManager/ButtonWidget.h b/include/GUIManager/ButtonWidget.h index 25e50c4..8a71ec0 100644 --- a/include/GUIManager/ButtonWidget.h +++ b/include/GUIManager/ButtonWidget.h @@ -25,6 +25,7 @@ public: virtual void OnTapDown(vec2 pos) { } virtual void OnTapUp(vec2 pos) { } virtual void OnTapUpAfterMove(vec2 pos) { } + virtual void OnTapUpAfterMoveOut(vec2 pos) { } virtual void OnMove(vec2 shift) { } virtual void OnMoveOut() { } virtual void OnKeyPress(int key) { } diff --git a/src/GUIManager/GUIManager.cpp b/src/GUIManager/GUIManager.cpp index 403d4af..ade271c 100644 --- a/src/GUIManager/GUIManager.cpp +++ b/src/GUIManager/GUIManager.cpp @@ -347,6 +347,21 @@ void TGUIManager::OnMouseUp(vec2 pos) //signalMap.push_back((i->SignalMap[CONST_CLICK_SIGNAL_NAME])); //Do not call signals here + if (! isTransparentForInput) + { + break; + } + } + + if (i->Widget->CheckClick(LastTapPos) && !i->Widget->CheckClick(pos)) + { + bool isTransparentForInput = i->Widget->IsTransparentForInput(); + i->Widget->OnTapUpAfterMoveOut(pos); + i->IsMouseDown = false; + + //signalMap.push_back((i->SignalMap[CONST_CLICK_SIGNAL_NAME])); + //Do not call signals here + if (! isTransparentForInput) { break; @@ -376,6 +391,8 @@ void TGUIManager::OnMove(vec2 shift) TotalShift += shift; + //LastTapPos += shift; + std::vector>> signalMap; for (i = WidgetArr.rbegin(); i != WidgetArr.rend(); ++i)