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 năm trước cách đây
mục cha
commit
df2f7b06a0
1 tập tin đã thay đổi với 3 bổ sung0 xóa
  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)
     {
         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;