Quellcode durchsuchen

Merge pull request #1103 from reven86/next-clean

fixed Button state changing after click/press
Sean Paul Taylor vor 12 Jahren
Ursprung
Commit
5041788dae
1 geänderte Dateien mit 2 neuen und 2 gelöschten Zeilen
  1. 2 2
      gameplay/src/Button.cpp

+ 2 - 2
gameplay/src/Button.cpp

@@ -50,8 +50,8 @@ bool Button::touchEvent(Touch::TouchEvent evt, int x, int y, unsigned int contac
                 y > _clipBounds.y && y <= _clipBounds.y + _clipBounds.height)
                 y > _clipBounds.y && y <= _clipBounds.y + _clipBounds.height)
             {
             {
                 _contactIndex = (int) contactIndex;
                 _contactIndex = (int) contactIndex;
-                notifyListeners(Control::Listener::PRESS);
                 setState(Control::ACTIVE);
                 setState(Control::ACTIVE);
+                notifyListeners(Control::Listener::PRESS);
                 return _consumeInputEvents;
                 return _consumeInputEvents;
             }
             }
             else
             else
@@ -70,8 +70,8 @@ bool Button::touchEvent(Touch::TouchEvent evt, int x, int y, unsigned int contac
                 x > _clipBounds.x && x <= _clipBounds.x + _clipBounds.width &&
                 x > _clipBounds.x && x <= _clipBounds.x + _clipBounds.width &&
                 y > _clipBounds.y && y <= _clipBounds.y + _clipBounds.height)
                 y > _clipBounds.y && y <= _clipBounds.y + _clipBounds.height)
             {
             {
-                notifyListeners(Control::Listener::CLICK);
                 setState(Control::FOCUS);
                 setState(Control::FOCUS);
+                notifyListeners(Control::Listener::CLICK);
             }
             }
             else
             else
             {
             {