Browse Source

When Button sends the Released event, make sure it's yet hovering if the mouse was released on top of it. See issue #1453.

Lasse Öörni 9 years ago
parent
commit
df2f7b06a0
1 changed files with 3 additions and 0 deletions
  1. 3 0
      Source/Urho3D/UI/Button.cpp

+ 3 - 0
Source/Urho3D/UI/Button.cpp

@@ -121,6 +121,9 @@ void Button::OnClickEnd(const IntVector2& position, const IntVector2& screenPosi
     if (pressed_ && button == MOUSEB_LEFT)
     if (pressed_ && button == MOUSEB_LEFT)
     {
     {
         SetPressed(false);
         SetPressed(false);
+        // If mouse was released on top of the element, consider it hovering on this frame yet (see issue #1453)
+        if (IsInside(screenPosition, true))
+            hovering_ = true;
 
 
         using namespace Released;
         using namespace Released;