mirror of
https://github.com/Redot-Engine/redot-engine.git
synced 2025-12-06 07:17:42 -05:00
Add Unit tests for viewport.cpp Physics 2D Picking
This commit is contained in:
@@ -177,6 +177,13 @@ int register_test_command(String p_command, TestFunc p_function);
|
||||
_UPDATE_EVENT_MODIFERS(event, m_modifers); \
|
||||
event->set_pressed(true);
|
||||
|
||||
#define _CREATE_GUI_TOUCH_EVENT(m_screen_pos, m_pressed, m_double) \
|
||||
Ref<InputEventScreenTouch> event; \
|
||||
event.instantiate(); \
|
||||
event->set_position(m_screen_pos); \
|
||||
event->set_pressed(m_pressed); \
|
||||
event->set_double_tap(m_double);
|
||||
|
||||
#define SEND_GUI_MOUSE_BUTTON_EVENT(m_screen_pos, m_input, m_mask, m_modifers) \
|
||||
{ \
|
||||
_CREATE_GUI_MOUSE_EVENT(m_screen_pos, m_input, m_mask, m_modifers); \
|
||||
@@ -215,6 +222,13 @@ int register_test_command(String p_command, TestFunc p_function);
|
||||
CoreGlobals::print_error_enabled = errors_enabled; \
|
||||
}
|
||||
|
||||
#define SEND_GUI_TOUCH_EVENT(m_screen_pos, m_pressed, m_double) \
|
||||
{ \
|
||||
_CREATE_GUI_TOUCH_EVENT(m_screen_pos, m_pressed, m_double) \
|
||||
_SEND_DISPLAYSERVER_EVENT(event); \
|
||||
MessageQueue::get_singleton()->flush(); \
|
||||
}
|
||||
|
||||
// Utility class / macros for testing signals
|
||||
//
|
||||
// Use SIGNAL_WATCH(*object, "signal_name") to start watching
|
||||
|
||||
Reference in New Issue
Block a user